四.JSON 和 JSONP 如果在同一个域下,$.ajax()方法只要设置 dataType 属性即可加载 JSON 文件.而在非 同域下,可以使用 JSONP,但也是有条件的. //$.ajax()加载 JSON 文件 $.ajax({ type:'POST', url:'test.json', dataType:'json', success:function(response,status,xhr){ alert(response[0].url); } }); 如果想跨域操作文件的话,我…