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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
also refer to this post here
https://www.experts-exchange.com/questions/20918005/Cross-browser-XSL-Javascript-solution.html
https://www.experts-exchange.com/questions/20918005/Cross-browser-XSL-Javascript-solution.html
if(-1 != navigator.userAgent.indexO
{
// Internet Explorer
document.write('<LINK YOUR XSLT FILE HERE">');
}
else if (-1 != navigator.userAgent.indexO
{
// Netscape document.write('<LINK YOUR XSLT FILE HERE');
}
else
{
// other
document.write('DEFAULT');
} //-->