Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

[Solved] Get iframe name with Vbscript

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Ruriko

Ruriko
  • Member
  • 6 posts
  • Joined 27-October 12
  • OS:Windows 7 x86
  • Country: Country Flag
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, 30 October 2012 - 06:48 PM.



How to remove advertisement from MSFN

#2
jumper

jumper

    2015 All-American Masters HJ'er

  • Member
  • PipPipPipPip
  • 556 posts
  • Joined 21-January 11
  • OS:98SE
  • Country: Country Flag
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, 27 October 2012 - 10:54 PM.

Design feedback requested:
KernelEx 4.5.2015
IHAtool - IpHlpApi tester; call various functions and report results
--status-> framework is solid; 22 api's fully supported; preview release coming soon
Future projects: Kexter - IP40+Ktree+Kexstubs




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users