[Solved] Get iframe name with Vbscript

2 posts in this topic

Hi I'm a newbie at vbscript and I was wondering how do I extract the iframe name? like for example if the string value contains:

<DIV style="MARGIN-TOP: 0px; WIDTH: 670px; HEIGHT: 210px; VISIBILITY: visible; MARGIN-LEFT: -335px; TOP: 48px" id=TB_window><DIV id=TB_title>  <DIV id=TB_ajaxWindowTitle>Add Media</DIV>  <DIV id=TB_closeAjaxWindow><A id=TB_closeWindowButton title=Close href="#" jQuery172014112867239284427="140"><IMG src=""></A></DIV></DIV><IFRAME style="WIDTH: 670px; HEIGHT: 180px" id=TB_iframeContent onload=tb_showIframe() src="" frameBorder=0 name=TB_iframeContent656 hspace=0>This feature requires inline frames. You have iframes disabled or your browser does not support them.</IFRAME></DIV> 

then the extracted name would be TB_iframeContent656

Edited by Ruriko

Share this post

Link to post
Share on other sites

If you can modify the iframe onload to be onload=tb_showIframe(, the tb_showIframe function will receive the iframe's name as its parameter.

Otherwise the script needs to know something as a starting point. If that is "id=TB_iframeContent" then the vbscript solution would be the syntactic equivalent of this javascript:

<script>var iframeName = document.getElementById("TB_iframeContent").name</script>

Note: if you want this to work in any browser other than IE, you should be scripting in javascript, not vbscript.

Edited by jumper

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.