ajax如何用php获取数据,别人的站点

WBOY
Release: 2016-06-23 14:38:41
Original
900 people have browsed it

它站js代码:$(function(){
    $('.UserContact').after('

ajax如何用php获取数据,别人的站点

...

');
    $.ajax({type:'POST',url:'/Ajax/AjaxUserInfo.aspx',data:({UID:$('.UserContact').data('id')}),dataType:'html',error:function(){alert('信息加载失败')},success:function(result){
        $('.loading').remove();
        $('.UserContact').after(result);
    }});
请问我用php怎么获取它传递过来的信息
比如这个网站的地址是http://www.1.com
uid=3,id=10

如果我想用一段php代码获取它的值,完整代码怎么写


回复讨论(解决方案)

他代码里面请求的地址不是php的url你怎么获取啊!(  $.ajax({type:'POST',url:' /Ajax/AjaxUserInfo.aspx',data:),这个地方要填写你的php地址,然后你就可以通过POST获取了(因为他设定的是post)

还有  如果要是跨域名的话  这个方法是没用的 要用jsonp跨域请求

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template