Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2008
    Location
    Vista, CA
    Posts
    59
    Thanks
    3
    Thanked 0 Times in 0 Posts

    help making a script to find the url of a frame

    I need help making a script to find the url of a frame. For example, in this piece of code
    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?
    Last edited by Christian271; 06-17-2008 at 02:04 AM.

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Location
    AZ, USA
    Posts
    685
    Thanks
    6
    Thanked 46 Times in 46 Posts
    parent.frames["content"].location.href should work.

  • #3
    New Coder
    Join Date
    Jun 2008
    Location
    Vista, CA
    Posts
    59
    Thanks
    3
    Thanked 0 Times in 0 Posts
    It's not working, dose it mater that the site in the frame belong to a different domain?

    thanks for your help!

  • #4
    Regular Coder
    Join Date
    Sep 2007
    Location
    AZ, USA
    Posts
    685
    Thanks
    6
    Thanked 46 Times in 46 Posts
    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?

  • #5
    New Coder
    Join Date
    Jun 2008
    Location
    Vista, CA
    Posts
    59
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Here's the code for the page I'm using it on,(mytoolbar.t35.com/my_toolbar.htm)
    Code:
    <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,
    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" value="ih">
    </frameset>
    </html>
    Last edited by Christian271; 06-18-2008 at 06:21 PM.

  • #6
    New Coder
    Join Date
    Jun 2008
    Location
    Vista, CA
    Posts
    59
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Anybody have any ideas?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •