I am calling two ajax function and the url is same ajax.php and both function are fired at the same time now problem is that how to show the response to the correct field
what i am doing
called function 1 and 2
for ex. in one i get steve, jobes and in two rahul, pankaj
i want to show the steve,jobes and rahul, pankaj in different field but
what i am getting is that both four name displayed in both field now i need to filter those name how to do this?
pass the callback along with the ajax call which will identify the correct place to populate.
For eg:
for 1st request you will send a callback
cb1('field1', ajaxresponse);and for 2nd request you will send a callback
cb2('field2', ajaxresponse);And then you can use the response as per your need to populate correct field
in jquery
in javascript
or if the function does the same job then pass the parameter or the initial request param to the function so that it wud populate the correct place