サイトにプロトタイプがあり、それも使用してい$
ます。
試す:
jQuery(document).ready(function($) { // This way you have no conflict with the $. In here $ refers to jQuery. All other places $ refers to document.getElementById (From prototype)
$("#left").css({'height':($("#right").height()+'px')});
});
実際に何が起こっているかは次のとおりです。
$(document) -> document.getElementById(document)* -> null
->
null.ready -> "sidebarheight.js:1 Uncaught TypeError: Object # has no method 'ready'"
* $(...) は GLOBAL.Element コレクションのプロトタイプを返すと考えてください
null
はオブジェクトですか?
はい
alert(typeof null); // object
と.....
jQuery(document).ready(...
ショートすることができますjQuery(...
:
jQuery(function($) { // This way you have no conflict with the $. In here $ refers to jQuery all other places et's refers to document.getElementById (From prototype)
$("#left").css({'height':($("#right").height()+'px')});
});