Problem with FireFox: javascript shown when page is loading

Discussion in 'JavaScript' started by celia05es, Apr 27, 2007.

  1. #1
    Hello,
    At one point of my application, I have the following environment:
    
    <frameset rows="20%,80%" >
    <frame src="horizontal.jsp" scrolling=no>
      <frameset cols="20%,80%" >
        <frame src="toc.jsp" name="frame1">
        <frame src="p1.jsp" name="frame2">
      </frameset>
    </frameset>
    
    Code (markup):
    The toc.jsp is as follows:
    
    ....
    <p>
    <a href="p1.jsp" target="frame2">P1</a><br>
    <p>
    <a href="p2.jsp" target="frame2">P2</a><br>
    <a href="p3.jsp" target="frame2">P3</a><br>
    <a href="p4.jsp" target="frame2">P4</a><br>
    ...
    
    Code (markup):
    So, at one point I have:

    <frame1> | <frame2>

    p1 |
    | p1.jsp
    p2 |
    p3 |
    ... |


    If I click on one of the link of frame1, BEFORE p1.jsp is loaded (on frame2), the javascript code of p1.jsp is shown on frame2. Once the page p1.jsp is loaded, the problem disappears.
    I only have this problem with Firefox, not with Explorer.

    Is there a way of preventing it?

    Thanks
     
    celia05es, Apr 27, 2007 IP
  2. WebGyver

    WebGyver Guest

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You could put the JavaScript code into an external file (myJavaScript.js) and then include it inside the HEAD section of p1.jsp.
     
    WebGyver, Apr 27, 2007 IP
  3. celia05es

    celia05es Guest

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It does not solve the problem. I still have the same thing.
    The p1.jsp file is now:
    
    <html>
    <title>Parameters list</title>
    <link rel="stylesheet" type="text/css" href="style.css">
    <head>
    <%@ include file="javascriptLib.html" %>
    <%@ include file="globalParameters.js" %>
    </head>
    ....
    
    Code (markup):
    The funny thing is that the javascriptLib.html code does not appear. Only the globalParameters.js code does!

    What am I doing wrong?
     
    celia05es, May 3, 2007 IP