ElliottClarke
Programmer
Hi Everyone,
Looking for some help. I'm a PHP developer quite new to Javascript. I'm currently trying to parse some information out of a text file and have started by using txtFile.open . My code is:
var txtFile = new XMLHttpRequest();
txtFile.open("GET", "../beers.txt", true);
txtFile.onreadystatechange = function() {
if (txtFile.readyState === 4) {
if (txtFile.status === 200) {
allText = txtFile.responseText;
lines = txtFile.responseText.split("\n");
var numberoflines = count(lines);
However, I keep getting 'Access is Denied' error for the txtFile.open("GET"... line.
I've tried every other method - file:/// etc
It DOES work using a remote HTTP address ( on my localhost but the whole point of this is that I want it to be accessible without using a server / the internet. Any help is gratefully received.
Elliott.
Looking for some help. I'm a PHP developer quite new to Javascript. I'm currently trying to parse some information out of a text file and have started by using txtFile.open . My code is:
var txtFile = new XMLHttpRequest();
txtFile.open("GET", "../beers.txt", true);
txtFile.onreadystatechange = function() {
if (txtFile.readyState === 4) {
if (txtFile.status === 200) {
allText = txtFile.responseText;
lines = txtFile.responseText.split("\n");
var numberoflines = count(lines);
However, I keep getting 'Access is Denied' error for the txtFile.open("GET"... line.
I've tried every other method - file:/// etc
It DOES work using a remote HTTP address ( on my localhost but the whole point of this is that I want it to be accessible without using a server / the internet. Any help is gratefully received.
Elliott.