i have an array called items=[\"apple\",\"mango\",\"cherry\"];
items=[\"apple\",\"mango\",\"cherry\"];
i wonder how i can load the array data from text file instead of declaring it?the text f
Sorry, but I don't believe it's quite that simple. Browsers restrict access to local drives (and to server drives) for security reasons.
But one way to access the text file using jQuery would be
jQuery.get('http://localhost/foo.txt', function(data) { var myvar = data; });