Javascript code doesn't work same in IE & Firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashim
    New Member
    • May 2006
    • 1

    Javascript code doesn't work same in IE & Firefox

    Hi Everyone,

    Please help me to solve a problem.

    I wrote a JavaScript code,
    but FireFox and IE have different results.

    The code is:
    alert (parent.frame2. location);
    parent.frame2.l ocation.href = "file2.htm" ;
    alert (parent.frame2. location);


    In FireFox the result is:
    .../file0.htm
    .../file0.htm

    In IE the result is:
    .../file0.htm
    .../file2.htm


    How can I make the result in FireFox to be the same as the result in IE?
    Thank you.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    The problem is not waiting until the page has loaded fully.

    If you try the running the code again, you will see that file2.htm is output for the first alert.

    Wait until the page has loaded before coding with the location.href.

    Comment

    Working...