Script For Detecting Availability of XMLHttp in Internet Explorer
By Duncan Mills-Oracle on May 08, 2010
Thanks to Blake Sullivan in the ADF Faces team we now have a little script that can do just this.
The script is available from the sample code page here, just look for the browserCheck.js sample - This is what you'll need to add to your project.
The best way to use this script is to make changes to whatever template you are using for the entry points to your application. If you're not currently using template then you'll have to make the same change in each of your JSPX pages.
- Save the browserCheck.js file into a /js/ directory under your HTML root within your UI project (e.g. ViewController)
- In the template or page, select the <af:document> object in the Structure window.
- From the right mouse (context) menu choose Facet and select the metaContainer facet.
- Switch to the source code view and locate the metaContainer facet. Then insert the following lines (I've included the facet tag for clarity but you'll already have that):
Note that the argument to the xmlhttpNativeCheck function is a page that you want to show to the user if they need to change their browser configuration. So build this page in the appropriate place as well. You can also just call the function without any arguments e.g.
xmlhttpNativeCheck();in which case it will pop up default instructions for the user to follow, but not redirect to any other page.