...

View Full Version : Includes



Fuego
08-24-2004, 02:11 PM
Okay imagine this is the main javasript its a short one but
I just want to get te logic and if it is posibble


if (choice == 1) {
var alert = " The first "
table = "<tr><td>" + alert + "Table</td></tr>"
}


Is there any way to include

"<tr><td>" + alert + "Table</td></tr>"

by a external file?Including the variable alert I did use?
Just putting this in an include an declaring it there like
string = "<tr><td>" + alert + "Table</td></tr>"

and calling it in the main js with
<script language="JavaScript" src="td.tpl"></script>
doesnt work..

Please help me out

Roy Sinclair
08-24-2004, 07:51 PM
Is this in response to a user action on the page or is this done when the page is first loaded?

jamescover
08-25-2004, 01:44 AM
When the page loads:



<table border="0" cellpadding="0" cellspacing="0" valign="top">
<tr>
<td valign="top">
<script type="text/javascript">
if (choice == 1) {
var alert = " The first ";
var table = alert + "Table";
document.writeln(table);
}
</script>
</td></tr></table>


-james

Fuego
08-25-2004, 10:16 AM
On the users action;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum