开发者

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.

  1. Server Generates page using PHP.
  2. Generated page is composed of HTML, JAVASCRIPT whatever...
  3. Client receives page
  4. 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.

  1. generate page with a tag, say <span id="js-val">123</span>
  2. have client read the contents of id="js-val
  3. client can then resend the 123 using POST or GET that really depends on what you want.

Hope it helps to clear things up.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜