Shoutbox

Load from a text file? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Load from a text file? (/showthread.php?tid=72986)

Load from a text file? by Ashylay on 03-24-2007 at 10:41 PM

Just wondering is it possible to load text from external text files?!?


RE: Load from a text file? by hmaster on 03-24-2007 at 10:51 PM

You can use MsgPlus.DownloadFile(); or a XML HTTP Request.

DownloadFile :
If you look in the scripting documentation under Objects Reference -> MsgPlus Object -> Functions -> DownloadFile there is an example for a text file :).

XML HTTP Request:

code:
http_request = new ActiveXObject("Microsoft.XMLHTTP");
http_request.open('GET', "http://server.com/test.txt", true);
     http_request.onreadystatechange = function(){
           if (http_request.readyState == 4) {
                if (http_request.status == 200) {
                     TextFileContents = http_request.responseText;
                }
           }
     };
http_request.send(null);