I've wrote a small JS script(Netscape's JS) that displays the contents of a txt file onto a Cell on my Home page that acts as a monthly news column. And I'm wondering if it could be a security issue as far as the script.
The script is a seperate file and is called upon in index.html(the home page).
Here's the script:
var page="mlmnews.txt";
function ajax(url,target)
{
if (window.XMLHttpRequest)
{
req = new XMLHttpRequest();
req.onreadystatechange = function() {ajaxDone(target);};
req.open("GET", url, true);
req.send(null);
}
else if (window.ActiveXObject)
{
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = function() {ajaxDone(target);};
req.open("GET", url, true);
req.send();
}
}
setTimeout("ajax('"+url+"','"+target+"')", 10000);
}
function ajaxDone(target) {
if (req.readyState == 4) {
document.getElementById('B2').innerHTML = req.responseText;
}
}
ajax('mlmnews.txt','ajaxlist');
And here's the calling code in index.html:
<script language="JavaScript" src="update_news.js"></script>
Anything?