I've only started reading up on development using ajax, and was testing the webpage in my local machine. All that the page contains is couple of lines of html, javascript, css and of course the request objects etc for ajax.
I was trying this - on page1.html, if you click on tab1 (an icon) in it, it should load a page named "page2.html" into the content div under the tab1 in page1.html (sort of like a frame). I was using ajax for this, something roughly like:
var url= "page2.html";
request.open("GET", url, true);
request.onreadystatechange = displayResult;
request.send(null);
So basically, clicking on the tab1 icon in page1 would load page2 into a portion of the page1, using ajax. On running, it ran into an error saying Access denied
, with line referring to the request.open()
.
I know that giving url = "page2.html"
will not suffice.
Question -
you can't get content of local files with XMLHttpRequest, except your modify configuration of your Browser:
in Opera on "about:config" page:
enable "Allow File XMLHttpRequest"