javascript - Get contents of external file and define as variable -
Is it possible to define a varible as the contents of the external text file?
Example:
function getfile () {var textfromfile = (content http://example.com/plain.txt); }
Plain.txt is a line and does not have long particlaly.
Because I'm using it for Chrome Extensions, I do not have permission to use PHP - is it an easy way in Javascript?
You Using JQuery can call Ajax and assign variable response,
$ .ajax ({url: "plain.txt", cache: incorrect}) .Done (function (html) {useIt (html);}); // useful for using variables after using callback function (variable) {warning (variable); }
Comments
Post a Comment