开发者

JQuery: Accessing Post parameters

开发者 https://www.devze.com 2022-12-24 05:53 出处:网络
Just started with JQuery and I\'ve managed to pass a parameter using POST, firebug confirms this: Parameters

Just started with JQuery and I've managed to pass a parameter using POST, firebug confirms this:

Parameters
link    test1@test.com
Source
link=test1%40test.com

I don't know how to access the link parameter from the receiving page using JQuery, it must be so simple but everything I've been searching through (jquery website, SO, etc) men开发者_Go百科tions everything but this.

Thanks, Alex


Javascript can not access POST. Sorry. You'll have to use a server-side technology, or use GET attributes, if appropriate.


Strictly speaking, javascript cannot access POST parameters. What you could do though is have your server side language write the value into the response so the client side script can access it. So on the server you might have

var postData = <?php echo $_POST['link']; ?>;

And then you would access it like any other variable.


You can only use POST parameters in request, being sent from client (javascript) to server. It won't make sense in other direction – server returns a response, not POST parameters. That's the fundamental issue, not javascript itself.

0

精彩评论

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