AJAX Made Easy - Learn AJAX



AJAX-Tips Tutorials

 
Home AJAX-Tips
 

Error Controls for IE and Firefox

 

IE and Firefox are the two most popular browsers online and in mobile devices. IE is the proprietary browser developed by Microsoft while Firefox is open source browsers that become the basis of other browsers. Since Firefox is basically the same compared to some smaller browsers, comparisons are usually on IE and Firefox only.


The difference of IE and Firefox goes a long way. The lay-out is different, the interaction with the user is different and plug-in handling is significantly different. IE doesn’t have a lot of plug-ins while Firefox’s claim to fame is on its ability to handle additional plug-ins. As an open source browser, there are thousands of plug-ins to choose from which could be useful, entertaining or sometimes annoying to users.


When Ajax came out, another difference of IE and Firefox came out. IE had some trouble handling cache of Ajax while Firefox’s security leaks have been identified.


Another difference in IE and Firefox are their protocols in handling XML errors. The XML file is very important in Ajax since it provides the needed data to the client side. If XML is successfully ported to the client side, the information will be available. However, errors do occur and each browser has their own way of dealing with this error.


IE on XML Errors

IE uses coding to determine if an error in retrieving XML happens. By default, the error code 0 will allow the transaction go through. This code means no problem was found and the application should be executed as planned. Anything beyond that is already an error. The number could be positive or negative but it will still be an error.


When an error occurs, IE will create a parseError object. This object will contain the information the developer needs to know about the error. It it’s a simple response to the error but very useful for the developer. The parseError object contains the following information:


• errorCode
• line – refers to the line number
• filePos – file position
• linePos – character position
• reason
• srcTex – text line of the error
• url


Some of the information on parseError object may or may not be useful for the developer. But the information will still be there.


Firefox on XML Error

Firefox on the other hand, handles XML Error in a more customized fashion. It does the same thing with IE but it just doesn’t stop there. After the XML error data is loaded in the parseError object, a documentElement is created. The developer could check the documentElement instead. The documentElement is basically a prompt that something is happening in your application and it could be used to load other information.


Another difference of Firefox in handling XML error is the data provided by the browser. Instead of seven tips, Firefox only provides five:


• Error Message
• File Name
• Line Number
• Position
• Source Code


Lastly, developers are also able to build custom error message whenever an error occurs. It could a simple error message to the user or a pop-up message which will serve as an alert box.



Read Next: Fallback Patterns for Ajax



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links