|
Answer» 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:
CODE: [Select]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:
Code: [Select]<script language="JavaScript" src="update_news.js"></script> Anything?I don't see how there could be a security RISK. The main way people exploit security is if there is a text field, or textarea etc on the page.Thanks Kpac for taking a look at it.
Just wanted to be sure. idea is good! Im just wondering about the search engine. Im just hoping that it will not consider it as spam, coz as your script says it will create like a new items on you page.
just my thought.
Quote from: kenjiemichael on April 03, 2009, 07:48:16 AM Im just hoping that it will not consider it as spam, coz as your script says it will create like a new items on you page.
It won't.
Quote from: macdad- on March 23, 2009, 04:58:51 PM...that displays the contents of a txt file onto a Cell on my Home page that acts as a monthly news column...
|