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 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2008
    Location
    Vista, CA
    Posts
    59
    Thanks
    3
    Thanked 0 Times in 0 Posts

    problom whith going to the top of the frame

    I'm trying to make a script for a button that goes to the top of another frame but it's not working and I can't find why. Here's the code (I think the problom is in the last onClick),
    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://www.">url</option>
    <option value="http://www.google.com/search?hl=en&q=">Google</option>
    <option value="http://www.ask.com/web?qsrc=167&o=0&l=dir&q=">Ask</option>
    <option value="http://search.yahoo.com/search;_ylt=A0oGkle.AVdI0j8B7tlXNyoA?p=">Yahoo!</option>
    <input name="urlinput">
    <input type="button" value="Go"
    onClick="parent.content.location.href = toolbar.search.value + toolbar.urlinput.value">
    <input type="button" value="Top"
    onClick="parent.content.scrollTo(0,0)">
    </form>
    
    </html>
    and here's the code for the page that loads it,
    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>

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You can not javascript control a page loaded in a frame/iframe which does not belong to the same domain as the parent.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New Coder
    Join Date
    Jun 2008
    Location
    Vista, CA
    Posts
    59
    Thanks
    3
    Thanked 0 Times in 0 Posts
    So there's no way to make the fame scroll to the top?

    Thanks for your help!


  •  

    Posting Permissions

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