Hi all
I'm using Dojo support for Ajax
function handleSubmit(evt, targetUrl, submitForm, updateDiv) {
dojo.stopEvent(evt);
dojo.xhrPost( {
url: targetUrl,
handleAs: "text",
load: function(response){
updateDiv.innerHTML = response;
wireEvents();
return response;
},
form: submitForm,
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
});
}
The response from the server contains more data than what I need. I'd like to be able to substitute this
load: function(response){
updateDiv.innerHTML = response;
wireEvents();
return response;
},
into something like
load: function(response){
updateDiv.innerHTML = dojo.byId('elemToExtract', response);
wireEvents();
return response;
},
I've to update my page with a portion of the ajax response. I need the ability to use the dojo.byId selector over the response (using the response as a context root or something like I found in jQuery).
Do you know how can I achieve this?
Thank you