The Internet Explorer "MSXML.XMLHTTP" (XmlHttpRequest Object) AJAX solution is fine if you are really careful not to create closures on any active controls in the process.
The following will already cause a memory leak...
request.onreadystatechange = function(request){
}
imagine what this will do...
request.onreadystatechange = function(request, dom, handler){
if(request.readystate == 4 && request.status == 200){
dom.loadXML(request.responseText);
handler.domLoaded();
}
}
How many people sit there and berate Microsoft products such as Internet explorer. One of the most common complaints is that IE is not as robust as FireFox or Mozilla.
If you look at what the developer is attempting to do when they have made the comment, you normally find they are trying to implement a "non standard" almost untested solution.
I have joined projects where the "propeller heads" have written some Visual Basic for Applications (VBA) inside a word document which parses the document for HTTP links and while attempting to use Microsoft Word as an Internet Browser complain that Microsoft Word is full of defects.
It does however seem that Mozilla products don't use ActiveX controls as part of their solution and they attempt to develop the solution to be an Object within the browser and not an external resource thus preventing and Operating System dependency for a developers solution.
Back in 1999 my project team were already using what is called an XML Island where we would script a Java Applet which communicated with an ASP page using GETs or POSTS.
The response was parsed on the server and the returned as JavaScript. The JavaScript was retrieved from the applet and eval'ed using the JavaScript. Ok this solution did require JAVA to be enabled in the browser and the version 4 browsers with JavaScript 1.2 were still new and all the calls to the server were synchronous but the JSON solution had no Memory leaks and there was no relying on a web browser's Garbage Collection of JavaScript objects. There were no Closures around expensive ActiveX controls such as XMLHttpRequest Objects and XmlDocument objects.
No comments:
Post a Comment