It is okay to change the link to php. & Quot; $. ajax ({type: & #39; GET & #39;, async: false, url: & quot; app. veishu. comjsonpcategoriesall. js & quot;, dataType: & quot; jsonp & quot;, success: function (data) {alert (& quot; success & quot ;); alert (data [0]); vardataHtml & quot; jsonpjs file php
It is okay to change the link to php.
$.ajax({ type:'GET', async:false, url:"http://app.veishu.com/jsonp/categories/all.js?1.1.29", dataType:"jsonp", success:function(data){ alert("success"); // alert(data[0]); // var dataHtml="" // for(var i=0; data.length;i++){ // dataHtml+=""; } $(".list").html(dataHtml); }, error:function(){ alert("ajax is error"); } });
This ajax will not enter error or success. An error is reported in the js of that link. If you change the link to php, success is successfully entered. However, the link to this js file is directly opened in the browser, and json can appear. What's going on? In addition, how can I convert unicode characters into JavaScript files in a browser! [Picture description] (http://img.ask.csdn.net/upload/201504/25/1429951452_561399.png)