SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE invisible page on refresh

    You can see my problem on with IE7
    http://www.spencerlearnstoprogram.com/index.php

    For some reason when you click "Go" on IE7 for to go to the actual address, the page loads perfectly.

    Yet, when I fresh only the background is shown.

    It started happening after I put in this code:
    Code:
    <script language="javascript" type="text/javascript">
    <!--
    function lgo(x)
    {
    	if (x == 1) var y = '<form action="index.php" method="post">Username:<input class="input1" name="username" type="text" /> Password:<input class="input1" name="password" type="password" /> <input value="Login" name="login" type="submit" /> <a href="javascript:lgo(2);">back &gt;</a></form>';
    	if (x == 2) var y = '<a href="javascript: lgo(1);">Sign In</a> | <a href="recovery.php">Forget your password?</a> | <a href="register.php">Register</a>';
    	z = document.getElementById("lgon");
    	z.innerHTML = y;
    }
    -->
    </script>
    This script is NOT run automatically... only when the user clicks a link.
    I did this to simplify the page a little. When the page first loads, if the user isn't logged in, a link to log in is displayed. When the user clicks on "sign in", this javascript is triggered and a form to signin is showed.

    I really don't get why refreshing is messing up the page. Where I put that javascript doesn't matter. If I take out the script, the page loads fine. In Firefox it works perfectly.

    I even tried saving the source of the blank page to a local HTML file. It displayed fine (though IE warned me of an ActiveX control trying to run).

    This is driving me nuts!

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, additional information:

    On refresh, the page stops displaying immediately after where the script is in the code.

    However, the HTML still loads in the browser... it just isn't displayed.

    EDIT:

    Now I'm REALLY confused.
    I tried commenting out the whole thing... even
    <script language="javascript" type="text/javascript"></script>
    anywhere on the page, will prevent IE from refreshing?! Am I the only one experiencing this?

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, I fixed it. IE is soo freaking rediculous.

    For some reason, I had to put the javascript BEFORE the <html> tag. *anywhere* else and the page refuses to refresh in IE7. What BS.


Bookmarks

Posting Permissions

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