jQuery AJAX type: 'GET', passing value problem.

Posted by Trez on Stack Overflow See other posts from Stack Overflow or by Trez
Published on 2010-03-09T08:49:29Z Indexed on 2010/03/09 8:51 UTC
Read the original article Hit count: 314

Filed under:
|
|
|

I have a jQuery AJAX call with type:'GET' like this:

$.ajax({type:'GET',url:'/createUser',data:"userId=12345&userName=test"},
   success:function(data){
     alert('successful');
   }
  );

In my console output is: GET:http://sample.com/createUser?userId=12345&userName=test params: userId 12345 userName test

In my script i should get the value using $_GET['userId'] and $_GET['userName'] but i can't get the value passed in by ajax request using GET method.

Any ideas on how to do this?

thanks,

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX