Jump to content

Recommended Posts

Posted (edited)

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="http://www.gorgeoushentai.com/wp-includes/js/thickbox/tb-close.png"></A></DIV></DIV><IFRAME style="WIDTH: 670px; HEIGHT: 180px" id=TB_iframeContent onload=tb_showIframe() src="http://www.gorgeoushentai.com/wp-admin/media-upload.php?post_id=168&" 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

Posted (edited)

If you can modify the iframe onload to be onload=tb_showIframe(this.name), 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

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.
×
×
  • Create New...