nvfellers

Members
  • Content count

    2
  • Joined

  • Last visited

About nvfellers

  • Rank
    Forum Newbie
  1. The root of this problem, when using xhtml, is that the rendered embed tag is not closed, thus not standards compliant. This fact does not bother IE or Firefox, which I assume are rendering in quirks mode; however, browsers like Safari and probably Chrome will not display the embedded charts. The top of my pages look as follows: !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" >
  2. 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