html - JavaScript IE read data from json file Access Denied -


i have problem code on ie browser , chrome in firefox works done.

var currentpage = 1; var max = 0; var mylist = []; var links = [];        $.ajax({         cache: false,         type : 'get',         crossdomain: true,         contenttype: "application/json",         datatype : 'json',         url: 'list.json',         success : function(data) {             $.each(data, function(key, value){                 if(window.location.href == value.link){                     document.getelementbyid("count").innerhtml = value.page;                     currentpage = value.page;                 }                 document.getelementbyid("countall").innerhtml = value.page;                 mylist.push("<li><a href=" + value.link +"><b>"+value.page+"</b></a></li>");                 max = value.page;                 links.push(value.link);                 })             $('.pagination').html(mylist.join(''));             if ( currentpage == 0){                 document.getelementbyid("leftarrow").innerhtml = "&#10096;"                 document.getelementbyid("rightarrow").innerhtml = "<a href="+links[currentpage]+">&#10097;</a>";             } else if (currentpage == max){                 document.getelementbyid("leftarrow").innerhtml = "<a href="+links[currentpage-2]+">&#10096;</a>";                 document.getelementbyid("rightarrow").innerhtml = "&#10097;"             } else {                 document.getelementbyid("leftarrow").innerhtml = "<a href="+links[currentpage-2]+">&#10096;</a>";                 document.getelementbyid("rightarrow").innerhtml = "<a href="+links[currentpage]+">&#10097;</a>";             }         }     }).error(function(jqxhr, textstatus, errorthrown) { alert(errorthrown); }); 

in ie have err: "access denied", know problem? reply.

why use crossdomain attribute since url accessing local?

 $.ajax({         cache: false,         type : 'get',         crossdomain: true // <--- cross domain 

in case need cross domain calls maybe should try jquery plugin ie:

https://github.com/moonscript/jquery-ajaxtransport-xdomainrequest


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -