paldie
asked on
jQuery.ajax Not Populating responseText
I have built the following function to make a search query against my server with jQuery's ajax call:
The ajax makes the call just fine and if i open firebug I can see the request and the HTML that it returned, but for some reason the responseText variable isn't being populated. Can anyone see an error with my function call?
function searchProducts(keywords,container,clicker,exclude){
/*
* @param keywords - words in the title of the category
* @param retContainer - the container for the results
* @param clickHandler - function to handle clicking of links returned
* @param exclude - a list of excluded category IDs
*/
var data = 'query=' + encodeURIComponent(keywords) + '&clicker=' + clicker;
if(typeof exclude == undefined)data = data + '&exclude=' + exclude;
else data = data + '&exclude='
var rethtml = jQuery.ajax({
url:'/index.cfm?action=admin:products.search',
dataType:'html',
data:data,
asynch:false,
type:'GET'
}).responseText;
container.html(rethtml);
return true;
}
The ajax makes the call just fine and if i open firebug I can see the request and the HTML that it returned, but for some reason the responseText variable isn't being populated. Can anyone see an error with my function call?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome! Thanks for the points!
ASKER