Rash
Rash

Reputation: 896

Ajax Returns errorError: Access is denied on IE

My following code works great on Firefox and Chrome, but shows error-error: Access is denied on IE, can anyone help me with it please.

On Firefox it returns Success as status and same success status on Chrome not sure why it doesnt work on IE 9.0

<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<script type="text/javascript">
$(document).ready(function () {
$.support.cors = true;
    $('#time').html(new Date());
    $('#status').html('');
    $('#content').html('');

    $.ajax({
        cache: false,
        url: $('#xhr_url').val()
    }).done(function (data, textStatus, jqXHR) {
        $('#status').html(textStatus+jqXHR);
        $.each(data.T2Json.PrinterManufacturers.Items, function (i, item) {
            $("#content").append('<a class="manufacturer" id="' + item.Id + '" onclick="hello(' + item.Id + ');" href="#">' + item.Name + '</a></br>');
        });
    }).fail(function (jqXHR, textStatus, errorThrown ) {
        $('#status').html(textStatus + errorThrown );
        $('#content').html('(failed)' + errorThrown);
    });
});</script>
</head>
<body>
  <input id='xhr_url' style='width:600px;' type='text' value='http://t2json.tgoservices.com/818746/PrinterManufacturers' />
<div id='content1'>ASS</div>
<fieldset>
    <legend>Time:</legend>
    <div id='time'></div>
</fieldset>
<fieldset>
    <legend>Status:</legend>
    <div id='status'></div>
</fieldset>
<fieldset>
    <legend>Content:</legend>
    <div id='content'></div>
</fieldset>
</body>
</html>

Upvotes: 2

Views: 1391

Answers (1)

alexcasalboni
alexcasalboni

Reputation: 1724

Check this out.

IE9 has known issues and limitations, as documented here.

Note: Supported somewhat in IE8 and IE9 using the XDomainRequest object (but has limitations)

You can read about XDomainRequest limitations here.

Upvotes: 1

Related Questions