开发者

jquery and php relations

how can i store jquery ajax result in a php variable? i mean i want to get result of ajax jquery and store it in php variable and ECHO i开发者_如何学Got later


Why do you want to do this?

What do you mean by "later"? Later, on the same page, or after the user navigates to another page?

If you want to echo it back to the page which has the ajax, then use js/jquery to echo it instead. If you want to save the variable in a session so that you can display it on another page, then you should be doing that on the php page you're presumably calling via ajax, rather than calling a php w/ ajax, having it return something, and then sending it back to the php again. However, if you really want to do that, you would have to stuff the variable into either a GET or POST variable so that it can be sent back to the server when the user navigates. i.e., put it into a hidden form and force the user to submit it, or put it into a link.... actually, you could do it with a 2nd ajax call, but now we're just going in circles aren't we?


why dont u use the data argument in the load function syntax for load $('selector').load(url,data,callback)

for data use {'key':'value'}

and then in php use $_REQUESTED

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜