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 8 of 8

Thread: onload problem

  1. #1
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onload problem

    Hey all,

    Ive got this problem, Ive added this function which reloads a frameset on the form (onload part).
    <body onload="top.frames[0].location.reload()">

    but this results in all other buttons not to work?? and i cannot navigate away from the page.???

    if i take the onload function out all buttons work?? any ideas on how i can solve this plz?

    thanks

  • #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
    Confusing.... Can you make it more precise, please? Which other buttons? What other buttons do? Navigate away from which page?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a form which has three frames one of them is header, main and footer. The header only loads once thus i cant do anything to it like disable it based on a action on a page....so i found this code below that onload <body onload="top.frames[0].location.reload()"> this reloads the first frame the header which is correct and i can disable the toolbar based on certain action..but the other buttons are
    Next to move away from the page, exit and Save jus dont work anymore...:S

  • #4
    New Coder
    Join Date
    Sep 2006
    Posts
    48
    Thanks
    0
    Thanked 1 Time in 1 Post
    I have a problem that has a similar effect. Basically I have javascript menu script that is supposed to load when the page loads and I have another script, basically a news ticker, that also is supposed to load when the page loads.

    It seems that if I have both trying to load when the page loads, only the first one that actually loads runs while the other one does not. I'm not sure but it seems that you can't have more than one thing that loads on page load.

    Anyone know a way around this?

  • #5
    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
    if boths codes invoke the window.onload (or simply onload) event to start some functions, you must "unify" somehow the onload

    onload=function(){
    startsFunctionOne();
    startsFunctionTow()
    }

    and make sure that there is no other window.onload or <body onload="something()"> in your page

    see also:
    http://onlinetools.org/articles/unob.../chapter4.html
    Last edited by Kor; 10-18-2006 at 05:56 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #6
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ive only got one onload function Kor....do u understand my problem??...ive put that code which reloads the toolbar in my body tag but when i click my Next or cancel buttons all it seems to do is reload the page again???

    any ideas how i can solve this.

  • #7
    New Coder
    Join Date
    Aug 2005
    Location
    Edmonton, Canada
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What Kor is saying is... a lot of these copy & paste scripts that you download off the Internet do a lot of behind-the-scenes work. In Paithar's case, the script for his news ticker 'could' invoke code such as: window.onload = initTicker;

    Now, it sounds like you might be using some form of menu system? If you coded the menu from scratch yourself then you're obviously familiar enough with the code to know if it runs any such window.onload = ... functions. But if you got it off the Internet, then all Kor is saying is that it's worth taking a closer look at the core of that code.

    Scripts interfere with eachother a lot. Be it using the same variable names, or overwriting the same function calls. What you described has the classic symptoms of two scripts conflicting with one-another.

  • #8
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok, im only running one javascript on "onload" its a problem that when i click next button it reloads the page and does not of the next functions...if i try to put a breakpoint on the next_click it doenst even reach it...when clicked it goes to Page_load and reloads the page because of the onload function in aspx page in body tag....i have no other javascripts.


  •  

    Posting Permissions

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