Link to home
Start Free TrialLog in
Avatar of preserver3
preserver3

asked on

javascript to do an xslt transform after a browser detect

I have a series of XML files that follow a standard schema for filling in content on a web page.  I have an XSLT for Netscape/Mozilla, and XSLT for IE, and several other XSLT's in the works for other browsers.  I want to do a javascript that rewrites the body text of a page with the transform appropriate to the right browser, with a default to IE if the detect fails.
Avatar of archrajan
archrajan

<!--
if(-1 != navigator.userAgent.indexOf("MSIE"))
{
 // Internet Explorer
document.write('<LINK YOUR XSLT FILE HERE">');
 }
else if (-1 != navigator.userAgent.indexOf("Mozilla"))
{
// Netscape document.write('<LINK YOUR XSLT FILE HERE');
}
else
{
 // other
document.write('DEFAULT');
} //-->
ASKER CERTIFIED SOLUTION
Avatar of archrajan
archrajan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial