jQuery AJAX type: 'GET', passing value problem.
- by Trez
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,