0
我怎样才能返回值是或没有到PHP函数。如果不是我可以做同样的JSONP功能的卷曲?从JSONP传递返回值到PHP
$.ajax({
url: 'www.example.com/trck.php',
type: 'GET',
data: 'adrs='+getHost(document.domain),
dataType: 'jsonp',
jsonp: false,
jsonpCallback: 'methodCallback',
success: function(data) {
if(data.message == "yes") { return yes;
} else {
return no;
}
},
error: function(error) {
console.log(error);
}
});
一行return the value **yes** or **no** to php function
我的意思是,我可以让PHP函数,它会调用上述AJAX脚本得到它的返回值..
编辑
经过一番研究后,我才知道那我不能将ajax值返回给php函数。
我可以在ajax上面做同样的功能吗?
返回什么PHP函数?你需要为此做另一个AJAX调用......或者实际上只是使用trck.php –
目前还不清楚你想要做什么或者你真正要求什么。 – TecBrat
@ZathrusWriter no no ajax call or not trck.php ..查看我更新的问题 – user2466317