javascript - A quick question on data returned by jquery.ajax() call (EDITED) -


edit: original problem due stupid syntax mistake somewhere else, whicj fixed. have new problem though, described below

i have following jquery.ajax call:

$.ajax({     type: 'get',     url: servicesurl + "/" + id + "/tasks",     datatype: "xml",     success : createtasklisttable }); 

the createtasklisttable function defined as

function createtasklisttable(tasklistxml) {     $(tasklistxml).find("task").each(function(){           alert("found task")          }); // each task } 

problem is: doesn't work, error saying tasklistxml not defined. jquery documentation states success functions gets passed 3 arguments, first of data.

how can pass data returned .ajax() function variable name of own choosing.

my problem i'm getting xml previous ajax call! how possible? previous function defined function convertservicexmldatatotable(xml), don't use same variable name.

utterly confused. caching issue? if so, how can clear browser cache rid of earlier xml?

thanks!

see comment. if you're using ie, ajax requests cached. jquery can solve adding random querystring variable request. change ajax call this:

$.ajax({     type: 'get',     url: servicesurl + "/" + id + "/tasks",     cache: false,     datatype: "xml",     success : createtasklisttable }); 

that add random querystring automatically, preventing browser caching request.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -