Forums / Developer / Rest API and XmlHttpRequest status / Comment68890
André R.
Thursday 23 June 2011 4:05:27 am
Try using jQuery/YUI perhaps? Or at least debug it using Firebug/Developer tools -> Network.I'm assuming url in code example got modified by this forum as having a tag inside url would not work.
Some nitpicks:
- Your writing to the DOM on every readystate callback, probably causing rendering reflows on every call. - 'dyn' is now a global variable - This will not work in IE 6, it does not have XMLHttpRequest object but an ActiveX object instead- I think you need to define xhr.onreadystatechange after xhr.open, but most people have have moved on to use libs for these things by now so not sure anymore.
If you absolutely have to code against pure javascript, try taking stuff from here maybe:https://github.com/ezsystems/ezoe/blob/master/design/standard/javascript/ezoe/ez_core.js#L774
Good luck ;)
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription @: http://twitter.com/andrerom