Internet Explorer上的JQuery Ajax错误 [英] JQuery Ajax Error on Internet Explorer

查看:135
本文介绍了Internet Explorer上的JQuery Ajax错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个Ajax请求,它在所有浏览器中工作,但在Internet Explorer中它不起作用。我需要它适用于Internet Explorer 9 +

I'm making an Ajax Request, it's working in all browser, but in Internet Explorer It's not working. I need that works for internet explorer 9 +

这是请求:

function loadYoutubeVideos(youtubeUrl){
var url = 'youtubeUrl';
$.ajax({
    type: 'GET',
    dataType: "json",
    url: url,
    success: function (responseData, textStatus, jqXHR) {
        objYoutubeVideos = responseData;
        //more functions, blablabla

    },
    error: function (responseData, textStatus, errorThrown) {
        console.log(textStatus, errorThrown);
        //error functions
    }   
});
}

我正在制作一些加载Facebook页面内容的代码。我该怎么办?

I'm making the some code for load a Facebook Page Content. What do I do?

推荐答案

您是否尝试过使用 jsonp 格式?

Have you tried to using jsonp format?

使用跨域(不同域)时, json 格式存在问题。

The json format has a issue when use over cross-domain (different domain).

所以,你需要使用 jsonp 而不是 json jsonp 使用javascript回调来解决跨域问题。

So, you need to use jsonp instead of json, jsonp using javascript callback for solve the cross-domain issue.

更多: http://www.sitepoint.com/jsonp-examples/

您不需要为api请求创建管道。

You don't need create pipe for api request.

Youtube支持 jsonp 格式使用& callback = 参数。

Youtube support jsonp format using &callback= parameter.

这篇关于Internet Explorer上的JQuery Ajax错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆