HTML help please

Associate
Joined
16 Sep 2005
Posts
75
Hi, I'm writing a website for uni and everything worked fine until yesterday when the JavaScript (embedded video opening in a new window from a link) on one of my pages just wouldn't work. The copy hosted on my webspace at uni works but the copy I have here at home suddenly doesn't do anything when the link's clicked.

I ran the file through a program called "JavaScript Code Improver" which outputted a file that worked fine, despite having identical code to the original. However, when I rename the new file to the same as the original, the script still works but none of the other pages of my site will link to it even though it has the right filename. Again, the links do nothing when clicked.

Any thoughts on how I can fix this?

Sorry if it's something trivial which I just can't see but I haven't been writing HTML for too long.

Thank you,

Karl
 
Thanks for the reply, I tried that but it's still the same. The script does work on the new file but the other pages just won't link to it.
 
Here's the code from the original page (the one that the other's link to but doesn't run the script). The code of the "improved" one is exactly the same.

All the pages are in the same folder and they link to the original, but not to the new one, renamed as the original.

Code:
<html>
  <head>
    <title>My Day in History</title>
    <link rel="stylesheet" type="text/css" href="style-black.css" /> <!-- specifies which stylesheet to use -->
  </head>
  <body>
    <div id="links"> <!-- the "links" division of the page -->
      <a href="intro.htm">Introduction<span>An introduction about myself</span></a>
      <a href="football.htm">Football<span>My favourite sport</span></a>
      <a href="birthday.htm">Birthday<span>My birthday in history</span></a>
      <a href="king.htm">King<span>Martin Luther King</span></a>
      <a href="everett.htm">Everett<span>Edward Everett</span></a> <!-- hyperlinks, containing <span> elements -->
    </div>
    
    <div id="content">
      <h1>Football</h1> <!-- main header -->

      <h3>My favourite sport</h3> <!-- paragraph header -->



      <p align="center"><a href=JavaScript:;><img src="images/france.JPG" alt="[Football video]" 
      width="128" height="96" border="0" onClick="openVideo()" /></a><br /><br />
      <i>Click the pic</i></p>
      
      <h4>Go to</h4>
      <ul>
        <li><a href="intro.htm">Intro</a></li>        <!-- list of links to other pages of the site -->
        <li><a href="football.htm">Football</a></li>
        <li><a href="birthday.htm">Birthday</a></li>
        <li><a href="king.htm">King</a></li>
        <li><a href="everett.htm">Everett</a></li>
      </ul>
    </div>

    <script type="text/javascript" language="JavaScript">

    function openVideo()
    {
    OpenWindow=window.open("", "newwin", "height=320,width=340,toolbar=no,menubar=no");
    OpenWindow.document.write("<html>")
    OpenWindow.document.write("<title>Football in France</title>")
    OpenWindow.document.write("<body bgcolor=000000>")
    OpenWindow.document.write("<embed SRC=videos/football.wmv autostart=true></embed>")
    OpenWindow.document.write("</html>")
    OpenWindow.document.close()
    self.name="main"
    }
    </script>

  </body>
</html>
 
I've got it working now guys! I think it was something to do with copying the site via ftp from my folder uni because if I unblocked a file ( "this file came from another computer"... ) then the other's wouldn't link to that one either.

Anyway I just made a new folder, new blank text files and copied the code into each one, which worked a treat. Thanks for the replies anyway guys!

Karl
 
Back
Top Bottom