duanping1920 2015-09-08 15:54
浏览 30

在file.php刷新之后从JQuery.load('file.php')传递JSON?

I am really sorry if this is confusing, I really had no idea how to word this.

I have a Hybrid App, and I want to allow a user to log via Twitter. I am using TwtterOAuth. Using Ajax load, I am able to get the authorising page into the app I do this by setting a php file on a server, which the app calls. This is then loaded into a div on the app, albeit a little messy.

But the user needs to sign in, and then authorise. Which I think is 2 refreshers. On the last refresh it should send me the users tokens which I can then use in telerik backend to set up the user. I am unsure how I can retrieve the JSON object out of the last refresh of the PHP file, and use it in the app. Normally one would use $.getJSON. But because there needs to be interaction, I am not sure how to do it ?

So I am using a modal div to load the auth:

$('#twitterModContainer').load('http:twcall.php');

Which shows me the authorise page on Twitter, waiting for the user to login, and click authorise. How would one proceed ?

  • 写回答

1条回答 默认 最新

  • douhan9619 2015-09-08 16:22
    关注

    You can pass data as a second argument on .load() function.

    $('#twitterModContainer').load('http:twcall.php',{ data: value });
    

    This will get passed as arguments which you can latter call them on the script as :

    $_POST["data"]
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大