开发者

Open Flash Chart on IE 8

I'm using Open Flash Chart 2 to present graphs and charts in my website. I'm trying to load the JSON data for a chart from the same page. There are several ways to do that.

  • Use get-data property of the chart and pass a javascript method that returns the json
  • Use the open_flash_chart_data method which the flash chart knows to read data from

All seem to work fine on FireFox, Chrome etc. The only browser that has a problem is IE (I'm using IE 8)

Looking a little into the open source I found that the library is using ExetrnalInterface to execute the javascript method, and altough the ExternalInterface seems to be available, it returns null for any execution of a method in IE.

It seems like this issue is already known for the Flash developers communit开发者_如何学JAVAy, so I did tried few things (though there are some solutions that I could not use in the library - for example unique id for the embed element. The library generates it)

In conclusion, I'm probably missing a simple solution for my problem.

My code:

This is the jquery call to the open flash chart from javascript:

$('#myDiv').flash
(
    {
        src: ofc_swf,
        width: "400",
        height: "250",
        allowscriptaccess: "always",
        wmode: "transparent",                 
        flashvars: {"get-data": "getFlashJson"}                       
    },
    {
        version: 8
    }
);

And this is the javascript method that will return the JSON source of the chart:

function getFlashJson()
{
    var val = $("#myJson").val();
    return val;
}

I'll appreciate any help on this.

Thanks


Try to update swfobject.js: for me, version 2.2 had resolved my problems.


I had this problem and found a solution.

Remove the parts of the flash code in the php file which preface the movie ID with ie_ and also change the SWFOBJECT javascript code to this:

function findSWF(movieName) {
  if (navigator.appName.indexOf("Microsoft")!= -1) {
    return window[movieName];
  } else {
    return document[movieName];
  }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜