Bin-Blog logoBin-Blog

Learn about the latest in Web Development – as soon as I do.

Success/Error Design Pattern For Ajax

By • Jun 22nd, 2007 • Category: Ajax, JavaScript, Web Development

‘Success/Error’ design pattern for Ajax requests is a JSON encoded string in a specific format – each response has a minimum of two elements in it – ie ‘success’ and ‘error’ – like this…

{
"success":"Task done successfully",
"error":false
}

OR

{
"success":false,
"error":"Database Connection Error!"
}

This method is used extensivly in Nexty. Almost all Ajax response in Nexty ares in this format.

Since this is in the JavaScript domain, I thougt it might be better to pubish the details in my OpenJS site. Read more about Success/Error Design Pattern For Ajax.


Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>