【发布时间】:2011-12-26 16:56:54
【问题描述】:
我有几个关于使用这个的问题。
1) 我需要从谷歌代码下载jquery.jsonp-2.1.4.min.js,但我应该把它放在哪个文件夹中? (我正在使用 xampp)在 C:\xampp 或 C:\xampp\htdocs?
2) 我应该写什么,以便我可以使用$.jsonp 将一些字符串从网络传递到我的本地服务器?我应该在“数据”输入中更改什么以传递变量str?
$.jsonp({
"url": "http://localhost/server.php",
"data": {
"alt": "json-in-script"
},
"success": function(userProfile) {
alert("ha"); // handle user profile here
},
"error": function(d,msg) {
alert("Could not find user ");
}
});
3) 如何在php页面中获取变量“str”?
<?php echo str; ?>
【问题讨论】:
标签: jquery jsonp google-code