MSFN Forum: [Solved] Get iframe name with Vbscript - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Solved] Get iframe name with Vbscript Rate Topic: -----

#1 User is offline   Ruriko 

  • Group: Members
  • Posts: 6
  • Joined: 27-October 12
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 27 October 2012 - 06:55 PM

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

This post has been edited by Ruriko: 30 October 2012 - 06:48 PM



#2 User is offline   jumper 

  • Masters HJ/TJ'er (back in training)
  • PipPipPip
  • Group: Members
  • Posts: 359
  • Joined: 21-January 11
  • OS:98SE
  • Country: Country Flag

Posted 27 October 2012 - 10:51 PM

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.

This post has been edited by jumper: 27 October 2012 - 10:54 PM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy