If your web pages have a .xhtml extension, following strict HTML 4.01 compliance, then they stop working in browsers that adhere to strict standards (e.g., Safari), when run on an application server. For my situation, the reason the pages have .xhtml extensions is that I am using JavaServer Faces (JSF) with Facelets. Separately, I believe mobile phones and other small devices also render xhtml, but I may be mistaken.
To solve the problem, I modified fusioncharts.js by revising the the render and getSWFHTML functions:
render: function(elementId){
else {
//Normal case. Instantly load the chart
if (navigator.appName.indexOf("Microsoft Internet") != -1) {
n.innerHTML = this.getSWFHTML();
}else {
var embed = document.createElement('embed');
this.getSWFHTML(embed);
n.appendChild(embed);
}
}
}
getSWFHTML: function(node) {
var swfNode = "";
if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
// netscape plugin architecture
node.setAttribute('type', 'application/x-shockwave-flash');
node.setAttribute('src', this.getAttribute('swf'));
node.setAttribute('width', this.getAttribute('width'));
node.setAttribute('height', this.getAttribute('height'));
node.setAttribute('id', this.getAttribute('id'));
node.setAttribute('name', this.getAttribute('id'));
var pairs = this.getVariablePairs().join("&");
var params = this.getParams();
for(var key in params) {
params[key].replace(/&/g, "&").replace(/, "<").replace(/>/g, ">");
node.setAttribute([key], params[key]);
}
if (pairs.length > 0){
pairs.replace(/&/g, "&").replace(/, "<").replace(/>/g, ">");
node.setAttribute('flashvars', pairs);
}
}else
Vance