AJAX-Design Tutorials
AJAX-DesignXSLT as Alternative to XHR
XSLT or Extensible Stylesheet Language Transformation has been used by developers for nearly 10 years. This transformer for XML has been very effective on its function that version 1.0 is still used until today - even with the presence of version 2.0.
Although version 2.0 is a lot superior compared to the original developers have opted to use the earlier version if they wanted to implement simpler websites.
With the popularity of Ajax based online applications, XSLT has taken a new function for developers. The function has become a transformer for XML files for JavaScript. Unfortunately, there are browsers that are unable to read XHR (XMLHttpRequest) for security reasons.
To combat this problem, developers have to transform XML into another form so that it could be launched to the alternative of XHR which is iFrame.
But launching XSLT is a little it difficult for developers especially when they have to build online applications for different browsers. The steps in building XML with the help of XHR is relatively less compared to XSLT transforming XML before it could be launched in iFrame.
Challenge for Developers iFrame
Although iFrame is a viable alternative for developers, it is not a surefire solution for developers who have a hard time dealing with a browser that doesn't support XHR. There are even browsers that can't easily handle iFrame and XSLT.
This is not a unique problem as the browser that will have a problem with XSLT will most likely have a problem with JavaScript in general as well. The newest browser, Google's Chrome, is still experiencing the pangs of a brand new browser and that includes the inability to handle other functions of JavaScript.
Another challenge is using timeouts in dynamic content. Developers have to introduce timeout functions in iFrame when trying to download dynamic content.
Timeouts will have the ability to prompt the application to restart downloading if no data was extracted. Timeouts and its relation to dynamic content is very useful as long as the browser and the local gadget could handle constant requests and changes in the browser.
Most modern browsers have the ability to handle timeouts with dynamic content but the user's gadget is never assured to handle this type of interaction online. Constant timeout and restart from the online application could considerably slow down the application especially when the user's gadget is not upgraded or the internet connection is not powerful.
Effective Handing of iFrame
The iFrame in an Ajax based application should be launched hidden as much as possible. Although it could be revealed to users, staying hidden will not only enable developers to handle iFrame easier but would also improve the website in terms of creativity and increased options.
If you find yourself stuck with callback function, use onload instead of properly defining the callback function. A properly defined function is recommended but it might not be working especially when the source is dynamic.
When using onload, developers should be able to target a source instead of stricter definition. iFrame with XSLT is a viable alternative for XHR but it should be regarded as an alternative only as other browsers and local gadgets might not be able to handle the requirements of the online application.
AjaxWith.com Offers
Sponsored Links
