NYCPHP Meetup

NYPHP.org

[nycphp-talk] Ajax 101: what to return from a POST

Felix Shnir felix.shnir at gmail.com
Thu May 3 15:25:28 EDT 2007


Jon means that the response status should be 412...

        var req = this.getTransport();
        req.open('POST', uri, true);
        req.onreadystatechange = function (aEvt) {
          if (req.readyState == 4) {
             if(req.status == 200)
              var r = eval(req.responseText);

               if(req.status == 412)
                  alert("error has occured: " + req.responseText);
              }
          }

Felix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070503/5a0f9cc4/attachment.html>


More information about the talk mailing list