Connect with Facebook   
    Home  |   Learn AJAX  |   Forum  |    Register  |    Submit Resource  |   Submit Article   |   Contact Us
 

AJAX XML

Home AJAX XML

Detecting XML in Browser

Category: AJAX XML   |   Comments (0)

XML is a must for most Ajax based applications. It’s a universal mark-up language which means almost any programming languages could work with XML. Aside from being accessible through various formats, it is also known to be relatively lightweight.


Sponsored Links
 

 


It can be used in small online applications for faster processing or could be implemented in robust applications for a more complicated data manipulation. By properly calling XML in the application, developers are assured of a well functioning application. In an asynchronous setting, this is a bit challenging because of difference scenarios developers have to deal with.


The Undying Browser Incompatibility

Although almost every developer in the world wishes that their coding could be universally accepted. But the opposite is the reality. The browser war in compatibility between IE enabled browsers and Netscape enabled browser doesn’t seem to have an end in sight specifically on interpreting some functions.


For that reason, access to XML has to be browser specific. The data itself could be read by browsers but on how it could be accessed and manipulated differs. JavaScript or Ajax based functions could be interpreted different in browsers. Without proper coding, the application will not work as expected.


Asynchronous Scenario in IE

To fully understand the difference between IE and Netscape on how to launch an Ajax based application, take a look on how the function is executed along with XML. In IE, asynchronous functions means it will wait for XML before launching anything first. Although this scenario looks good, it offers a problem for other users who can’t handle the bandwidth requirement.


The solution to this concern is actually very simple – the asynchronous command (xmlDoc.async) should be set to FALSE. Placing a TRUE value on the command will only inform the browser to wait for the XML to fully load before other functions are executed.


Working with Netscape

Instead of making some changes on the asynchronous function through True or False commands only, Netscape will allow developers to specifically load a function after XML is available. If you’re developing for Netscape, you won’t need to prevent complete loading since you can control which function will be executed.


Netscape based browsers will simply load the function after XML has been implemented. This is an imperative since Netscape related browsers will not have any capacity without targets. In this case, the functions in Netscape really need XML before they could do anything in the browser.


More Work in IE

IE’s dealing with asynchronous loading of XML is more than simple FALSE value. Developers could customize the loading of other functions in the browser while the XML is in different stages. The function used for customizing loading is the readyState. The ready state could be paired with five values which are the following:


0 = XML has not initialized
1 = XML started without data read yet
2 = XML is loading
3 = XML is almost ready that it could be used in some functions
4 = XML is ready.



Sponsored Links
 

 

By choosing the right value, the application in IE browsers will work well with XML.



Read Next: Using CDATA in Ajax


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

Post Your Comment via FaceBook

Connect with Facebook



 
Comments
 
 
 
 

Sponsored Links

 

Copyright © 2005 - 2010 AjaxWith.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape