views:

663

answers:

5

Hi ,

I am trying to read the post request parameters from my html.I can read the get request parameters using the following code in javascript.

$wnd.location.search

But it does not work for post request.Can anyone tell me how to read the post request parameter values in my html using javascript.

Thanks.

+1  A: 

that's not possible.

RageZ
+1  A: 

You can't get them. What do you need to do? Can you not just write them to HTML from the server-side code?

Noon Silk
+2  A: 

JavaScript is a client-side scripting language, which means all of the code is executed on the web user's machine. The POST variables, on the other hand, go to the server and reside there.

So it's pretty much impossible to read the POST variables. The GET variables are a fluke, because they're in the URL and that's something that the client machine knows about.

Platinum Azure
+4  A: 

POST data is data that is handled server side. And Javascript is on client side. So there is no way you can read a post data using JavaScript.

rahul
A: 
$(function(){
    $('form').sumbit{
        $('this').serialize();
    }
});

in jQUery the above code would give you the url string with post parameters in in the url . its not impossible to extract the post parameters . to use jQuery you need to include the jQuery library use the following for that

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"></script>
Bunny Rabbit