Hi - I've found this strange one using flot and jsonp. I get an error with JQuery 1.4 that I do not get with 1.3.2. The error occurs in IE7, but not in Firefox.
I'm using jsonp (http://jquery-jsonp.googlecode.com) to get graph data and flot (http://code.google.com/p/flot/) to render that data.
- $.plot($("#chartDiv"),
- [{"lines":{"show":true},"data":[[1259625600000,5305],[1259712000000,6539]]}]
- );
But retrieving that same json data via ajax call cause a script error. I get an
error on line 465 of
http://code.jquery.com/jquery-latest.js
(Unexpected call to method or property access)
- // Not own constructor property must be Object
- if ( obj.constructor
- && !hasOwnProperty.call(obj, "constructor")
- && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") )
- {
- return false;
- }
This works fine in Firefox on both 1.3.2 and 1.4 versions of jQuery. I
have example code below (& attached) to reproduce (you'll need to download flot to run it)
Should I open this as a bug in jQuery 1.4 ? Or could it be something in Flot
or jsonp that is just exposed by 1.4 release of jQuery.
- <html>
- <head>
- <script language="javascript" type="text/javascript" src="./flot/excanvas.js"></script>
- <!-- <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script> -->
- <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js" >
- </script><script type="text/javascript" src="http://jquery-jsonp.googlecode.com/files/jquery.jsonp-1.0.4.min.js"></script>
- <script type="text/javascript" src="./flot_0.6/jquery.flot.js" ></script>
- <script type="text/javascript">
- $(document).ready(function(){
- //alert("this works on IE 7");
- $.plot($("#chartDiv"),
- [{"lines":{"show":true},"data":[[1259625600000,5305],[1259712000000,6539]]}]
- );
- url = "http://thesullies.com/jquery_1.4_flot_ie7_error.json";
- $.jsonp( {
- url : url,
- timeout : 10000,
- success : function(data, textStatus) {
- //alert("this will fail on IE 7 (with jquery 1.4)");
- $.plot($("#chartDiv"), data);
- },
- complete : function(xOptions, textStatus) {
- if (textStatus == "error" || textStatus == "timeout")
- alert("Unable to retrieve URL:"+url+", error = "+textStatus);
- }
- });
- });</script>
- </head>
- <body>
- <div id="chartDiv" style="width:600px;height:300px;"></div>
- </body></html>