PHP and JQuery Question
Is there a way I can pass a PHP variable from a PHP page to a JQuery page and back to 开发者_运维知识库a PHP page?
Maybe I'm wrong but I believe you may be confusing things.
- Server Generates page using PHP.
- Generated page is composed of HTML, JAVASCRIPT whatever...
- Client receives page
- Received page is interpreted (JavaScript code is run)
In the end what you are asking for is possible but, by the way you put the question, I though that the above should be clarified.
How to do it?
Say you want to pass id=123
from server to client and then back.
- generate page with a tag, say
<span id="js-val">123</span>
- have client read the contents of
id="js-val
- client can then resend the 123 using
POST
orGET
that really depends on what you want.
Hope it helps to clear things up.
精彩评论