FusionCharts Forum: Javascript error in IE8 (SetReturnValue method) - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Javascript error in IE8 (SetReturnValue method) Microsoft JScript runtime error: Object doesn't support this property or method

#1 User is offline   trashCanMan 

  • Forum Newbie
  • Group: Members
  • Posts: 5
  • Joined: 16-March 09

Posted 11 May 2009 - 06:55 AM

Hello,

I am testing IE8 and it is showing the following error:

"Microsoft JScript runtime error: Object doesn't support this property or method"

when executing this code:


try 

{ 

    document.getElementById("graficoCotacoes").SetReturnValue(__flash__toXML(FC_Loaded("graficoCotacoes")) );

} catch (e) 

{ 

    document.getElementById("graficoCotacoes").SetReturnValue("");

 }



I have debugged the javascript code in FusionCharts.js and on line #255 and noticed that on the "if" condition, the instruction
document.embeds[this.getAttribute('id')]
returns 'undefined' and immediately after, the exception is thrown!!!

At the time i wasn´t able to find out where is the bug!

Is this a known problem?



Thank you

Simão Fernandes

Portugal
Simão G. Fernandes
0

Other Replies To This Topic

#2 User is offline   Sudipto Choudhury 

  • Supreme Being
  • Group: Administrators
  • Posts: 1886
  • Joined: 19-March 07

Posted 12 May 2009 - 12:54 AM

HI,

Could you please let us know whether you have set registerWithJS option on while rendering the chart.

Please also try running the application from a web server.

Regards,

Sudipto Choudhury
FusionCharts Team

Follow us on Twitter

I code, therefore I am.

0

Other Replies To This Topic

#3 User is offline   atorres 

  • Forum Newbie
  • Group: Members
  • Posts: 6
  • Joined: 05-March 10

Posted 03 June 2010 - 03:44 PM

I am having the same problem, My code works in Chrome and FF but throws an error in IE.



This is the error I am getting:

Line: 1

Error: Object doesn't support this property or method


When I debug with IE i find the error is on this line.

try { document.getElementById("mainChart").SetReturnValue(__flash__toXML(FC_Loaded("mainChart")) ); } catch (e) { document.getElementById("mainChart").SetReturnValue(""); }




I attached my source code perhaps someone can tell me if I'm doing something obviously wrong.





< !doctype html>

< html xmlns=" http://www.w3.org/1999/xhtml" >

< head>

< title> Test< /title>

< script SRC=" /js/fusionCharts/FusionCharts.js" type=" text/javascript" > < /script>

< script SRC=" /js/fusionCharts/FusionChartsExportComponent.js" type=" text/javascript" > < /script>



< /head>

< body>



< a class=" button" href=" javascript:void(0);" onclick=" initiateExport();" > Export/Print Chart< /a>

< br />

< div id=" mainChart" style=" " > The chart will appear within this DIV. This text will be replaced by the chart.< /div>

< script type=" text/javascript" >

var myChart = new FusionCharts(" /charts/FusionCharts/Column3D.swf" , " mainChart" , " 900" , " 300" , " 0" , " 1" );

myChart.setDataXML(" < chart exportEnabled='1'exportShowMenuItem='1'exportAtClient='1' exportHandler='fcExporter1' exportFileName='MyFile' showAboutMenuItem='0' showExportDataMenuItem='1' caption='Monthly Sales Summary' subcaption='For the year 2006' xAxisName='Month' yAxisName='Sales' numberPrefix='$'> < set label='January' value='17400' /> < set label='February' value='19800' /> < set label='March' value='21800' /> < set label='April' value='23800' /> < set label='May' value='29600' /> < set label='June' value='27600' /> < set label='July' value='31800' /> < set label='August' value='39700' /> < set label='September' value='37800' /> < set label='October' value='21900' /> < set label='November' value='32900' /> < set label='December' value='39800' /> < /chart> " );

myChart.render(" mainChart" );

< /script>

< div style=" float:left" id='handlerDivWrapper'>

< div id='exportHandlerDiv'> FusionCharts Export Handler Component< /div>

< /div>

< script type=" text/javascript" >

var fcExportComponent = new FusionChartsExportObject('fcExporter1', '/charts/FusionCharts/FCExporter.swf');

fcExportComponent.sourceCharts = " ['mainChart']" ;

//Full Mode

fcExportComponent.componentAttributes.fullMode = '1';

//Set saving type to individual

fcExportComponent.componentAttributes.saveMode = 'both';

//Show allowed export format drop-down

fcExportComponent.componentAttributes.showAllowedTypes = '1';

//Width and height

fcExportComponent.componentAttributes.width = '350';

fcExportComponent.componentAttributes.height = '250';

//Message - caption of export component

fcExportComponent.componentAttributes.showMessage = '1';

fcExportComponent.componentAttributes.defaultExportFileName = " my_file" ;

fcExportComponent.componentAttributes.message = 'Save file(s) in desired format, then open file to print or attach to email.';

//Render the exporter SWF in our DIV fcexpDiv

fcExportComponent.Render(" exportHandlerDiv" );

function initiateExport(){

fcExportComponent.BeginExportAll();

}

< /script>

< /body>

< /html>





By the way SANATIZE YOUR FORM INPUTS It makes me sick that i had to html encode my source just to post on your site...
0

Other Replies To This Topic

#4 User is offline   atorres 

  • Forum Newbie
  • Group: Members
  • Posts: 6
  • Joined: 05-March 10

Posted 04 June 2010 - 09:20 AM

I figured out the problem...

I basically make sure the div that the javascript is being injected into does not have the same id as the chartId otherwise IE will throw an error.
0

Other Replies To This Topic

#5 User is offline   atorres 

  • Forum Newbie
  • Group: Members
  • Posts: 6
  • Joined: 05-March 10

Posted 04 June 2010 - 09:24 AM

By the way I also recommend adding



//Add wmode transparency to allow overlay

this.addParam('wmode', 'opaque');





to the FusionCharts.js file provided by FC to allow for overlaying any html you may want on top of the chart.
0

Other Replies To This Topic

#6 User is offline   Basundhara Ghosal 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2459
  • Joined: 15-September 09

Posted 07 June 2010 - 01:16 AM

Hi,

Thanks for sharing your idea.

:)

Regards,

Basundhara Ghosal

Follow us on Twitter :D
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic