Click to See Complete Forum and Search --> : scripts in a table
angeliamy
12-02-2002, 10:51 AM
I am trying to get a menu made from Javascript to appear in a table. However the code isn't showing in the table. It is referring to a script run outside the main page. The code is below.
<table border="1"><tr><td align="left">
<script type='text/javascript'>
function Go(){return}
</script>
<script type='text/javascript' src='exmplmenu_var1.js'></script>
<script type='text/javascript' src='menu_com.js'></script>
<noscript>Your browser does not support script</noscript>
</td><td align="right"><img src="images/schools1.gif" width="72" height="462" alt="" border="0"></td>
</tr>
</table>
Any help would be greatly appreciated!!
gil davis
12-02-2002, 03:43 PM
You have not provided enough information. Can you post a link?
angeliamy
12-02-2002, 03:54 PM
It's not sitting anywhere you could reach it. It's on a test server. What else do you need to know? This is the beginning of an idea...
gil davis
12-02-2002, 04:13 PM
My first reaction is that you do not have a <table> tag or a <tr> tag to start the table.
You have a script embedded in the body of the document, and without knowing what is in that script, no one will be able to tell you exactly what is wrong.
Following the script, is a <noscript> tag, which would be out of place if the table was built correctly. In fact, if scripting was disabled, the missing table elements would render your HTML invalid. Browsers are not obliged to render invalid HTML.
Without knowing what your intentions are, I doubt if anyone could help further.
angeliamy
12-03-2002, 07:57 AM
I'm not sure what you mean, the script is embedded in the beginning and ending table and tr tags. The script is referring to an external menu script.
With or without my code how do you put a script into a table? Is there a general format for this?
gil davis
12-03-2002, 10:24 AM
I'm not sure what you mean
That makes two of us.
the script is embedded in the beginning and ending table and tr tags.
No it's not. You jhave no beginning <TABLE> tag.
The script is referring to an external menu script.
Well, Duh! It would help to see that code.
With or without my code how do you put a script into a table?
That depends on what you want the script to do (which you still haven't answered).
Let's say for simplicity sake you had a script that you use on all your pages that writes some silly text. The script file looks like this:
document.write("this is some really silly text");
and that's all there is in the file. Let's call it "silly.js" and save it, ok? Then in your HTML page, you have the following:
...
<table>
<tr>
<td><script src="silly.js"></script>
<noscript>You'd see some pretty silly text if you had javascript</noscript></td>
</tr>
</table>
...
Is there a general format for this?
I don't think so. You have to follow the HTML markup rules.