StivenUSB
03-02-2007, 07:48 AM
I tried converting html to javascript using an online code converter, once the html converted to javascript, I saved the javascript output to a .js file. What I would like to do is have a single line in my html displaying the js content so that I can go in and change only this .js file when updating is needed. I expect the content to be displayed on multiple websites. If I update it from my server, I'd like it to change on all sites that the script would be on...
So what I did was saved the javascript output I received, after converting the html to javascript, to a .js file and I tried making the content appear on my regular page by doing something like this <script language="javascript" src="http://www.mydomain.com/FILENAME.js"></script> but it is definitely not working...
Is it possible to do something like this? If not, is there an alternative other than using an iFrame which I don't want to do...? The javascript code once it was converted from html is pasted below...
Any help is greatly appreciated,
Stiven USB
-----------------------------------------------------------------------
<script type="text/javascript" language="JavaScript">
<!--
document.writeln('<table width="380" border="1" bgcolor="#666666">');
document.writeln(' <'+'!--DWLayoutTable-->');
document.writeln(' <tr bgcolor="#000066"> ');
document.writeln(' <td colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#666666">');
document.writeln(' <'+'!--DWLayoutTable-->');
document.writeln(' <tr> ');
document.writeln(' <td width="371" height="39" align="center" nowrap><a href="http://www.ultimatesportsbets.com"><img src="http://www.ultimatesportsbets.com/javabanner.gif" width="370" height="39" border="0"></a></td>');
document.writeln(' </tr>');
document.writeln(' </table></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln(' <td width="87" height="20" bgcolor="#000066"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong><u>Sport:</u></strong></font></td>');
document.writeln(' <td colspan="2" valign="top" bgcolor="#000066"><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">NBA ');
document.writeln(' Basketball</font></strong></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln(' <td bgcolor="#000066"><u><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>Match-up:</strong></font></u></td>');
document.writeln(' <td width="272" valign="top" bgcolor="#000066"><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Orlando ');
document.writeln(' Magic (-7) @ Detroit Pistons</font></strong></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln(' <td bgcolor="#000066"><u><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>Pick:</strong></font></u></td>');
document.writeln(' <td valign="top" bgcolor="#000066"><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Detroit ');
document.writeln(' Pistons (+7)</font></strong></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln(' <td bgcolor="#000066"><u><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>Record:</strong></font></u></td>');
document.writeln(' <td valign="top" bgcolor="#000066"><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">11-3 ');
document.writeln(' ATS</font></strong></td>');
document.writeln(' </tr>');
document.writeln('</table>');
//-->
</script>
So what I did was saved the javascript output I received, after converting the html to javascript, to a .js file and I tried making the content appear on my regular page by doing something like this <script language="javascript" src="http://www.mydomain.com/FILENAME.js"></script> but it is definitely not working...
Is it possible to do something like this? If not, is there an alternative other than using an iFrame which I don't want to do...? The javascript code once it was converted from html is pasted below...
Any help is greatly appreciated,
Stiven USB
-----------------------------------------------------------------------
<script type="text/javascript" language="JavaScript">
<!--
document.writeln('<table width="380" border="1" bgcolor="#666666">');
document.writeln(' <'+'!--DWLayoutTable-->');
document.writeln(' <tr bgcolor="#000066"> ');
document.writeln(' <td colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#666666">');
document.writeln(' <'+'!--DWLayoutTable-->');
document.writeln(' <tr> ');
document.writeln(' <td width="371" height="39" align="center" nowrap><a href="http://www.ultimatesportsbets.com"><img src="http://www.ultimatesportsbets.com/javabanner.gif" width="370" height="39" border="0"></a></td>');
document.writeln(' </tr>');
document.writeln(' </table></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln(' <td width="87" height="20" bgcolor="#000066"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong><u>Sport:</u></strong></font></td>');
document.writeln(' <td colspan="2" valign="top" bgcolor="#000066"><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">NBA ');
document.writeln(' Basketball</font></strong></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln(' <td bgcolor="#000066"><u><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>Match-up:</strong></font></u></td>');
document.writeln(' <td width="272" valign="top" bgcolor="#000066"><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Orlando ');
document.writeln(' Magic (-7) @ Detroit Pistons</font></strong></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln(' <td bgcolor="#000066"><u><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>Pick:</strong></font></u></td>');
document.writeln(' <td valign="top" bgcolor="#000066"><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Detroit ');
document.writeln(' Pistons (+7)</font></strong></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln(' <td bgcolor="#000066"><u><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>Record:</strong></font></u></td>');
document.writeln(' <td valign="top" bgcolor="#000066"><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">11-3 ');
document.writeln(' ATS</font></strong></td>');
document.writeln(' </tr>');
document.writeln('</table>');
//-->
</script>