MooTools: How to use responseText directly
Posted
by
Johny
on Stack Overflow
See other posts from Stack Overflow
or by Johny
Published on 2011-01-04T11:35:22Z
Indexed on
2011/01/05
10:54 UTC
Read the original article
Hit count: 234
In following example of code, I want to traverse the responseText object which consist the html code came from request_page.php file. In onSuccess event, i want to check whether < Div > with id 'ersDiv' has any errors posted in it.
new Request.HTML({
url: 'request_page.php',
onSuccess: function(responseText, responseXML) {
// My expected code to handle responseText object
alert(errorMessage);
},
onFailure: function() { }
});
request_page.php file is like this :
<div align='center'><div id='ersDiv'>Page loaded with insufficient data</div></div>
© Stack Overflow or respective owner