0

I am using twitter bootstrap rails with jQuery 1.7 When I load my project it works fine, except for an error in jQuery file. I am assuming this is is affecting my highcharts and the graphs are not displayed.

However can somebody help me resolve this issue: This is from line 633 inside jquery.extend() function: 632. var name, i = 0, 633. length = object.length, 634. isObj = length === undefined || jQuery.isFunction( object );

Here is the error: TypeError: 'undefined' is not an object (evaluating 'undefined.length')

Can somebody please help?

Best,

anipendakur
  • 85
  • 10
  • What is the code which is given the error. Does the error refer to a line number or something like that? Would be helpfull. – Lumocra Jul 12 '12 at 18:01
  • It was jQuery min version, I replaced it with jquery full. It gives me an error at line 633: TypeError: 'undefined' is not an object (evaluating 'object.length') And the line 633 is in jQuery.extend function: . . each: function( object, callback, args ) { var name, i = 0, length = object.length, isObj = length === undefined || jQuery.isFunction( object ); – anipendakur Jul 12 '12 at 20:38
  • Can you paste the code you are using? – Amit Jul 12 '12 at 21:11
  • I am working on rails, hence I'm sorry, I can't really paste the entire code. I have a single view page which does not have this error, it loads the chart successfully! Trying to figure out what is different about this page.. – anipendakur Jul 12 '12 at 21:26

1 Answers1

0

Figured the problem out. It was a minor fault in my JS handling. I was not checking for existence of an array created out of a div at my front end.

changed the code from

$.each($myArr, function(key,value){ . . . });

to

if($myArr){ $.each($myArr, function(key,value){ . . . }); }

This was a common JS file that was loaded to a number of views. Changing this worked! :)

anipendakur
  • 85
  • 10