AJAX-Tips Tutorials
AJAX-TipsBrowser Conditioned CSS Selector
An Ajax based application could tend to be browser specific when developers do not consider the disparity of the different browsers. Unfortunately, the current configuration of an Ajax based application will not work in all browsers.
From JavaScript configuration to XHR interpretation, developers will always consider the browsers that will read the application. CSS is one of the functions that developers have to consider. It ca not be easily loaded in a specific browser. It has to be preconditioned to a specific browser.
Using CSS for JavaScript in IE has always been a hot topic. IE interprets CSS differently compared to other browsers. Aside from browser specific problems, the different versions of IE also interpret CSS differently. Naturally, this setting for IE will confuse every developer.
Microsoft does not release different versions for IE fast but the legacy of each browser continues for a long time which will overlap the latest version of the browser. As a result, developers have to build the Ajax based application with different CSS versions.
Developing this type of application will take time and very tedious. Maintenance will also be difficult in this application. To say it is a nightmare could be an understatement.
Developers have exercised a “hack” to properly use CSS in the application. This hack has been used for browsers in IE6 and below. Fortunately, this hack could be discarded in the latest version of IE. But there is still a disparity of different versions that developers have to consider.
With the release of IE7, developers can now use conditional commenting to properly build the application. Conditional commenting could provide a challenge in building an application but its better compared to building a totally different version of application for a specific version of IE.
The difficulty could be reduced with conditional commenting as each browser and browser versions could have their commands for proper execution.
But this solution has been contested by different developers. Conditional commenting can solve the problem of browser and browser version disparity but it has created another problem. Conditional commenting can’t be validated which could be a little bit uncomfortable for some developers.
The application will not achieve full validation which will then be a problem for some browsers. But so far, it has worked and browser is not really strict with validation. The application will still be rendered in the browser even though it didn’t achieve 100% validation.
The goal of conditional commenting for IE7 is not for validation but for user interactivity. In the end, developers have to think about the interaction of the user with the application. The advantages that could be taken from IE7 have to be used up to its full potential as it could be at par with different browsers with regards to being user friendly.
Right now Microsoft is working towards full compatibility with its latest updates on its programming languages, but for now developers have to work with this setting to ensure that their Ajax based application could be read by IE7 browsers and earlier.
Sponsored Links
