Script For Detecting Availability of XMLHttp in Internet Explorer
Posted
by Duncan Mills
on Oracle Blogs
See other posts from Oracle Blogs
or by Duncan Mills
Published on Sat, 08 May 2010 19:13:30 -0800
Indexed on
2010/05/10
17:26 UTC
Read the original article
Hit count: 389
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 https://samplecode.oracle.com here - The attached file browserCheck.js 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):
<f:facet name="metaContainer">
<af:resource type="javascript"
source="/js/browserCheck.js"/>
<af:resource type="javascript">
xmlhttpNativeCheck(
"help/howToConfigureYourBrowser.html");
</af:resource>
</f:facet>
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.
© Oracle Blogs or respective owner