javascript - Loading a text file through AJAX gives restricted URI error -


I mentioned that I read the suggested link ... and are unable to understand the suggestion. "Greasemonkey Use

to write a few javascript to modify the page and modify the web page loading a text file with $ .jax Get the following error:

Error: ["Access denied denied URI" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" Location: "& lt; Unknown & gt; "]

Here is my code:

     ; Prime> gt; src src = "http: //ajax.googleapis com / ajax / libs / jquery / 1.10.2 / jquery.min.js" & gt; & lt; / script & gt; & lt ; Script language = "javascript" type = "text / javascript" & gt; $ (document) .ready (function () {$ ("button") click (function () {$ .ajax ({url: "demo_test .txt ", success: work (result) {$ (" # div1 ") HTML (result);}, error: function (ABC) {warning (abc.statusText);}, cache: incorrect}); description is false ;});}); & Lt; / scrip Gt; & lt; body & gt; & lt; body & gt; div id = "div1" & gt; & lt; h2 & gt; let's replace jQuery with AJAX this text & lt; / h2 & & Gt; & lt; / div & gt; & gt; Button & gt; Get external content & lt; / button & gt; & lt; / body & gt; & lt; / html & gt;  < / Pre> 

I have already read the following question:

It was suggested that the file The system should not be used, so the URL was changed, but he did not solve the issue.

I have also heard that this may be due to a cross domain issue if so, then what does that really mean, and how should I solve this problem?

Browser protection prevents code from running on a local server like IIS or Apache.

Firefox

  1. You can visit:

  2. Search for security.
  3. Set it to false

Comments