Tomo

Fusioncharts Json Object Overwrite In Ie7

Recommended Posts

I use Mootools and FusionCharts the same time. When I include FusionCharts.js after including Mootools.js, the JSON object in Mootools seems be overwriten by JSON defined in FusionCharts. Otherwise, when I include FusionCharts.js before including Mootools.js, the JSON object is properly handled (mootools append attributes to the JSON object, not overwrite the JSON object).

I test this and find that only IE7 has this behavior.

code in FusionCharts:

var JSON;JSON||(JSON={});

 

 

code in Mootools:

if (!this.JSON) this.JSON = {};

Share this post


Link to post
Share on other sites
Guest Sumedh

I use Mootools and FusionCharts the same time. When I include FusionCharts.js after including Mootools.js, the JSON object in Mootools seems be overwriten by JSON defined in FusionCharts. Otherwise, when I include FusionCharts.js before including Mootools.js, the JSON object is properly handled (mootools append attributes to the JSON object, not overwrite the JSON object).

I test this and find that only IE7 has this behavior.

code in FusionCharts:

var JSON;JSON||(JSON={});

 

 

code in Mootools:

if (!this.JSON) this.JSON = {};

 

Hi,

 

Can you paste your sample code here? it would be helpful for us to look into the issue.

Share this post


Link to post
Share on other sites

Hi,

 

Can you paste your sample code here? it would be helpful for us to look into the issue.

 

the sample is simple:

<html>
<head>
<script type="text/javascript" src="./static/lib/jQuery/jquery-1.4.4.js"></script>
<script type="text/javascript" src="./static/lib/MooTools/mootools-big.js"></script>
<script type="text/javascript" src="./static/lib/MooTools/mootools-compat-big.js"></script>
<script type="text/javascript" src="./static/lib/FusionCharts/JSClass/FusionCharts.js"></script>
<script type="text/javascript">
$(document).ready(function(){
   people = {"name": "tomo"};
   console.log(people);
   alert(JSON.encode(people));
});
</script>
</head>
<body>
</body>
</html>

 

the console raise this error:

SCRIPT438: Object doesn't support property or method 'encode'

Do you need the mootools or the fusioncharts js?

Share this post


Link to post
Share on other sites
Guest Sumedh

the sample is simple:

<html>
<head>
<script type="text/javascript" src="./static/lib/jQuery/jquery-1.4.4.js"></script>
<script type="text/javascript" src="./static/lib/MooTools/mootools-big.js"></script>
<script type="text/javascript" src="./static/lib/MooTools/mootools-compat-big.js"></script>
<script type="text/javascript" src="./static/lib/FusionCharts/JSClass/FusionCharts.js"></script>
<script type="text/javascript">
$(document).ready(function(){
   people = {"name": "tomo"};
   console.log(people);
   alert(JSON.encode(people));
});
</script>
</head>
<body>
</body>
</html>

 

the console raise this error:

SCRIPT438: Object doesn't support property or method 'encode'

Do you need the mootools or the fusioncharts js?

 

Hi,

 

This is a known issue of Mootools with IE7.

 

So please contact support team of Mootools for this issue.

Share this post


Link to post
Share on other sites

Hi,

 

This is a known issue of Mootools with IE7.

 

So please contact support team of Mootools for this issue.

 

Thanks!

Share this post


Link to post
Share on other sites

Hi,

 

Can you paste your sample code here? it would be helpful for us to look into the issue.

 

Also, to appeal to a logic, the code in FusionCharts.js var JSON; JSON || (JSON={}); and mooTools definition is exactly the same... just written in a cooler syntax by us. ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now