OZONE Asylum
Forums
DHTML/Javascript
JSON eval() problems with IE
This page's ID:
29265
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Ok, so I played with it some more taking into account your advice. I got some interesting results. [code] var sample_input_data = "0.0,1.0:1.0,21.0:2.0,321.0:3.0,2005.0:4.0,7737.0:5.0,22461.0:6.0,54121.0:7.0,114381.0:8.0,219345.0:9.0,390277.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:10.0,654321.0:"; var myColumnHeaders2 = [ {key:"x",className:"col1"}, {key:"y",className:"col2"} ]; var myColumnSet2 = new YAHOO.widget.ColumnSet(myColumnHeaders2); var jsonPoints = formatStringToJSON(sample_input_data); alert(jsonPoints.data_points) var myDataSource2 = new YAHOO.util.DataSource(jsonPoints.data_points); myDataSource2.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; myDataSource2.responseSchema = { fields: ["x","y"] }; var myDataTable2 = new YAHOO.widget.DataTable("scroll",myColumnSet2,myDataSource2,{scrollable:true}); function formatStringToJSON(inputString) { var point_sets = inputString.split(":"); var json_text = ""; for (x = 0; x < point_sets.length-1; x++) { var point = point_sets[x].split(","); json_text += "{ x: \"" + point[0] + "\", y: \"" + point[1] + "\"}, "; } return eval( 'data_points = { points: [' + json_text + '] } '); // return 1. //return eval( ' { points: [' + json_text + '] } '); // return 2. } [/code] When using return line 1 It neither works in FF nor IE saying "Loading data..." However, there are no errors in IE or FF (using firebug) When using return line 2 (and changing the alert statement and declaration of the Yahoo Datasource) It works in FF, but does not work in IE, stating "Loading data.." and there is an error in the code in IE only on line 774. Quite peculiar. Thanks for your response. [small](Edited by [url=http://www.ozoneasylum.com/user/2057]beaner[/url] on 06-08-2007 01:01)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »