dongxia527680 2011-09-30 18:37
浏览 52
已采纳

如何将数据发送到跨服务器的php文件?

While developing a native Android app using Dreamweaver's "build" functionality, I found out that I had to use Jquery's JSONP functionality to access dynamic data. The dynamic data, pulled from a mySQL database and populated into a php file, is considered "cross-server," because the web-language-created Android app resides in the Android device, while the php file resides on the web server (I think? I couldn't ajax in the data like I could when I hosted the web app.).

I can display the dynamic data from the php file easily with a JSONP scrip inject...but what if I wanted to do a user-specified filter on the data? (Send to the php file which "linkID" was clicked)

I've read that jquery's .getJSON() function can send data (currently only using it to pull data):

function jsoncallback(data){
console.log(data);
}
$.getJSON("http://crossServerPhpFile.php?jsoncallback=?",
  { linkID: "0"});

But is there a way to send a GET variable to the cross-server php file?

  • 写回答

2条回答 默认 最新

  • duangou1551 2011-09-30 18:44
    关注

    Not sure really if i understood it correctly but here is what i think you can do:

    $.getJSON("http://crossServerPhpFile.php?linkId=0&jsoncallback=?");
    

    sending the linkid directly in the url.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题