Hej, jag undrar om någon kan hjälpa mig att ändra följande skript så att den hämtar länkarna från en fil (lank.txt) istället.
Jag vill använda detta skript för att ha aktuella nyheter, men då vill jag bara ändra det i en fil. Om det nu går förståss (jag är inte bra på JS).
<!-- Start 1:a Nyhetstabell -->
<center>
<table bgcolor="#CC3300" border="0" cellpadding="1" cellspacing="0" width="95%">
<tr>
<td>
<table bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#CC3300" height="25">
<td height="25" width="1%"> </td>
<td height="25"><font size="2" face="Arial, Helvetica, Verdana" color="#FFFFFF"><b>Nyheter</b></font></td>
</tr>
<tr height="25">
<td height="25" width="1%"> </td>
<td height="25">
<font face="Arial, Helvetica, Verdana" size="2">
<br>
<SCRIPT LANGUAGE="Javascript"><!--
// ***********************************************
// AUTHOR: [url]WWW.CGISCRIPT.NET,[/url] LLC
// URL: [url]http://www.cgiscript.net[/url]
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( [url]http://www.cgiscript.net/scripts.htm[/url] )
// ***********************************************
function text() {
};
text = new text();
number = 0;
// textArray
text[number++] = "Här är text nr 1"
text[number++] = "Här kommer en <a href=http://www.domain.com>hyperlänk</a>"
text[number++] = "Random text string 3."
text[number++] = "Random text string 4."
text[number++] = "Random text string 5."
// keep adding items here...
increment = Math.floor(Math.random() * number);
document.write(text[increment]);
//-->
</SCRIPT>
<br><br>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<!-- Slut 1:a Nyhetstabell -->