Howto pass JSON to page2 after redirect from page1

I'm wondering how to pass JSON to a page when 1) being rendered for the first time or 2) after a redirect. Let's say I have page1 and page2. page1 makes a POST to a webservice. That webservice then redirects to page2, but with a JSON response. I can't think of a way for page2 to take that JSON as a parameter and use it. JQuery ajax (with JSON or JSONP) all work on the premise that it's page2 making the call. Is there a way of doing this (I've definitely dug through the similar answers [here][1] and [elsewhere][2])? Should I be shoving that data in the Headers ? Thanks [1]: https://stackoverflow.com/questions/6263450/php-how-to-open-page1-redirect-to-page2-and-show-page1-in-a-div-dom [2]: http://www.eriksmartt.com/blog/archives/319
if you absolutely need to redirect and so not want to use ajax, pass it as a parameter to your page2, or save the data in a session and load it just in page 2. Therefor you don't even need json. You can directly serialize your array, object ... in the session. Or are you talking about Javascript only without any session management on server side?

以上就是Howto pass JSON to page2 after redirect from page1的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏