...

View Full Version : help making a script to find the url of a frame



Christian271
06-16-2008, 10:20 PM
I need help making a script to find the url of a frame. For example, in this piece of code

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>My Toolbar</title>
</head>
<frameset rows="28,*">
<frame src="my_toolbar.htm" scrolling=no marginwidth=0 marginheight=0>
<frame src="http://therealmers.divinusdies.net" name="content">
</frameset>
</html>
the script would come up with the url of frame "content" being http://therealmers.divinusdies.net. Does anybody have any ideas?

binaryWeapon
06-17-2008, 07:47 PM
parent.frames["content"].location.href should work.

Christian271
06-17-2008, 08:06 PM
It's not working, dose it mater that the site in the frame belong to a different domain?

thanks for your help!:D

binaryWeapon
06-17-2008, 08:25 PM
You can't access the DOM of another site, but if the actual frame element is on your domain, you should be able to access it. What page are you using the code on? Are you trying to use it with the page that contains the code from your original post?

Christian271
06-17-2008, 08:54 PM
Here's the code for the page I'm using it on,(mytoolbar.t35.com/my_toolbar.htm)


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>My Toolbar</title>
<body background=images/bg.jpg>
</head>

<form name="toolbar">
| <select name="search">
<option value="http://">Web Address</option>
<option value="http://www.ask.com/web?qsrc=167&o=0&l=dir&q=">Ask</option>
<option value="http://www.google.com/search?hl=en&q=">Google</option>
<option value="http://search.yahoo.com/search;_ylt=A0oGkle.AVdI0j8B7tlXNyoA?p=">Yahoo!</option>
<option value="http://en.wikipedia.org/wiki/">Wikipedia</option>
<option value="http://wiki.answers.com/Q/Special:Search&search=">WikiAnswer</option>
<input name="urlinput">
<input type="button" value="Go"
onClick="parent.content.location.href = toolbar.search.value + toolbar.urlinput.value">
<input type="button" value="T"
onClick="toolbar.urlinput.value = parent.frames["content"].location.href">
</form>

</html>


and here's the code for the page I'm loading the first page in and the frame I want to find the url of,


<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>My Toolbar</title>
</head>

<frameset rows="28,*">
<frame src="my_toolbar.htm" scrolling=no marginwidth=0 marginheight=0>
<frame src="http://therealmers.divinusdies.net" name="content" value="ih">
</frameset>
</html>

Christian271
06-22-2008, 05:05 PM
Anybody have any ideas?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum