qwerty Posted April 3, 2009 Share Posted April 3, 2009 hello.i'm quite new to html (and javascript), that's why i need your help. i want to use a menu on my web page, and i chose to use includes instead of frames (obviously). i have installed apache on my PC and i enabled server-side includes: it works great.in my index.shtml file i wrote this line: <table cellspacing="0" id="menu"> <tr> <td><a href="index.html" class="nav" id="homenav">Home</a></td> </tr> <tr> <td><a href="news.html" class="nav" id="newsnav">News</a></td> </tr> <tr> <td><a href="desc.html" class="nav" id="abnav">About</a></td> </tr> <tr> <td><a href="contact.html" class="nav" id="connav">Contact</a></td> </tr> </table> but the problem is that at my school there is no web server installed, so i am unable to use SSI. that's why i need to use javascript.i tried to do it like this, but it didn't work:i wrote this in the body of my index.html: document.writeln("<table cellspacing='0' id='menu'>");document.writeln(" <tr>");document.write(" <td>");document.write("<a href='index.html' class='nav' id='homenav'>");document.write("Home");document.write("</a>");document.writeln(" </td>");document.writeln(" </tr>");document.writeln(" <tr>");document.write(" <td>");document.write("<a href='news.html' class='nav' id='newsnav'>");document.write("News");document.write("</a>");document.writeln(" </td>");document.writeln(" </tr>");document.writeln(" <tr>");document.write(" <td>");document.write("<a href='desc.html' class='nav' id='abnav'>");document.write("About");document.write("</a>");document.writeln(" </td>");document.writeln(" </tr>");document.writeln(" <tr>");document.write(" <td>");document.write("<a href='contact.html' class='nav' id='connav'>");document.write("Contact");document.write("</a>");document.writeln(" </td>");document.writeln(" </tr>");document.write("</table>"); please point me in the right direction....thanks Link to comment Share on other sites More sharing options...
jeffman Posted April 3, 2009 Share Posted April 3, 2009 There is no reason why that code should not work. Just to be sure, I actually ran your set-up (Firefox 3.x) and it does work. The language="Javascript" part should not be there, but that won't cause the problem.There must be a detail you've forgotten to mention.Your script file doesn't have <script> tags in it, does it? Link to comment Share on other sites More sharing options...
jesh Posted April 3, 2009 Share Posted April 3, 2009 <script language="Javascript" src"menu.js" type="text/javascript"></script> You're missing an equals sign:<script language="Javascript" src="menu.js" type="text/javascript"></script> Link to comment Share on other sites More sharing options...
jeffman Posted April 3, 2009 Share Posted April 3, 2009 You're missing an equals sign: Mea culpa! Link to comment Share on other sites More sharing options...
qwerty Posted April 4, 2009 Author Share Posted April 4, 2009 oh my god... i can't believe it... thank you very much and sorry for wasting your time... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.