Aaron Cronje

Aaron Cronje

  • NA
  • 256
  • 263.3k

Switch Statement

Nov 30 2011 12:12 PM
Hi...
          I am working in ajax and face a problem in switch statement. How can we define switch statement in ajax?
switch(this.xhr.readyState) {
case 3:
var e = new AjaxEvent(this);
this.dispatchEvent('data', e);
break;
case 4:
try {
// Only continue if status OK
if (this.xhr.status == 200) {
var e = new AjaxEvent(this);
this.dispatchEvent('load', e);
}
} catch (ex) {
var e = new AjaxEvent(this);

Answers (1)