1

私はいくつかの同様の質問を準備し、jqueryが含まれている最初のスクリプトであることを確認しました...

// this test confirms that jquery is defined
if (typeof jQuery == 'undefined') {
    alert('jquery not defined');    
}
// (this is being alerted)
else { alert( 'jquery is defined'); }

// this is what I want to achieve (to begin with)
jquery("#free-signup").css( 'display', 'none' );

そしてjqueryは定義されているようです...私は何が間違っているのですか?!

4

1 に答える 1

4

JavaScript では大文字と小文字が区別されます。正しいオブジェクト名を使用する必要があります:

// v
  jQuery("#free-signup").css( 'display', 'none' );

またはショートカット:

$("#free-signup").css( 'display', 'none' );
于 2012-11-20T12:36:14.577 に答える