intanpalupidn / jquery-oembed

Automatically exported from code.google.com/p/jquery-oembed
0 stars 0 forks source link

Do not override the jQuery object type function #19

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
On line 200:

var oembed = $.extend(data);

being data the json object return by the ajax call, you are actually extending 
the jQuery object. This is a very dangerous practice. I was having several 
weird errors saying jQuery.type was not a function. In effect, the type 
function was overrode by the data.type property.

You could just write

var oembed = data;

as the $.getJSON already returns a js object.

Thanks a lot for you work!!

Original issue reported on code.google.com by rform...@gmail.com on 28 Nov 2010 at 4:07

GoogleCodeExporter commented 8 years ago
+1 this should be commited to the plugin. Using the plugin with jQuery 1.4.4 
throw many errors like said above (jQuery.type was not a function).

Original comment by brunober...@gmail.com on 12 Dec 2010 at 7:50