跨域ajax请求 [英] Cross domain ajax request

查看:126
本文介绍了跨域ajax请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从跨域网址获取HTML响应页面。

I want to get the html respond page from the cross domain url.

为了这个,我现在用的是Ajax请求的,

for this I am using the ajax request as,

 $.ajax({
            type: 'GET',
            url: "http://wcidevapps.com/salescentral/idisk/0001000383/iDisk",
            dataType: "jsonp",
            success: function (response) {
                $(response).find('li a').each(function () {
                    listHref.push($(this).attr('href'));
                });

            }
        });

但要求它不与任何结果回击后。

But after requesting it doesn't respond with any result back.

推荐答案

检查文档: http://api.jquery.com/jQuery.ajax/

crossDomain (default: false for same-domain requests, true for cross-domain requests)
Type: Boolean
If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5)

这篇关于跨域ajax请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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