js calls flash to report error in chrome

1. There is an error in the flash generated dynamically embedded in the web page. The error information is as follows:

     #25081850 myChartId::RendererManager Error >> There was an error rendering the chart. Enable FusionCharts JS debugMode for more information.

2. Error reason: chrome disable flash Plug-in

3. Solution:

Before generating flash dynamically, place a blank flash to prompt the user to click to allow the current website to run flash

The blank flash code is as follows:

   

<div id="flashEmpty" style="z-index: 5"> //Blank flash
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100" height="100"
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">
        <param name="wmode" value="transparent">
     <embed src="media.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
        type="application/x-shockwave-flash" width="200" height="115"></embed>
   </object>
</div>
<div  style="z-index: 6" id="chart1div" align="center" >Your dynamic generation flash position</div> 
<script type="text/javascript">
var width=document.body.clientWidth;
var chart1 = new FusionCharts("Gantt.swf", "myChartId", 500, 500, "0", "1");
chart1.setDataXML(Dynamically generated xml Chart file);
chart1.render("chart1div");
// Hide blank flash when judging that normal flash has been generated
setTimeout(function(){
var obJ =document.getElementById("chart1div").childNodes;
var name = obJ[0].nodeName;
if(name.toUpperCase() == 'OBJECT'){
document.getElementById("flashEmpty").style.display = 'none'
}
},500)

</script>

4. How to check whether the user has successfully joined the flash white list in chrome

Open the blank page of Google browser and input: chrome://settings/content/flash. Check whether the allowed list includes the following

5. Disadvantages of this treatment

Every time the user clicks, the page will be forced to refresh

Keywords: Javascript xml Google

Added by Negligence on Mon, 23 Dec 2019 19:14:27 +0200