1 Replies - 572 Views - Last Post: 18 February 2014 - 07:21 AM

#1 nrjd  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-September 09

Exception… “Access to restricted URI denied” code: “1012” nsresult: “0

Posted 18 February 2014 - 06:56 AM

I am loading Text File with $.ajax() .I am running it on FireFox . it gives me above Error

My Code :

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        $("button").click(function () {
            $.ajax({ url: "demo_test.txt",
                success: function (result) {
                    $("#div1").html(result);
                },
                error: function (abc) {
                    alert(abc.statusText);
                },
                cache:false
            });
            return false;
        });
    });
</script>
</head>
<body>

<div id="div1"><h2>Let jQuery AJAX Change This Text</h2></div>
<button>Get External Content</button>

</body>
</html>



it is more suggested that file system should not be used ... so changed the url to http://demo_test.txt .. but not worked

it is suggested that it is Cross domain issue . what exactly mean by that ? and how do I supposed to solve it Please suggest

Is This A Good Question/Topic? 0
  • +

Replies To: Exception… “Access to restricted URI denied” code: “1012” nsresult: “0

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3569
  • View blog
  • Posts: 10,402
  • Joined: 08-June 10

Re: Exception… “Access to restricted URI denied” code: “1012” nsresult: “0

Posted 18 February 2014 - 07:21 AM

just to verify the answer from your SO thread, how exactly do you call the HTML file in your browser (address bar)?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1