0

プラグインを使用してほとんどのモデルをインラインで編集可能にしたいのですが、次のことがわかりません。

これを使用するには、テンプレートにjquery.rest_in_place.jsを含め、ドキュメントのonLoadハンドラーで次のコマンドを実行します。

jQuery( "。rest_in_place")。rest_in_place();

http://jan.varwig.org/projects/rest-in-place

これはどこに置きますか?

4

2 に答える 2

3

それらはおそらくjQueryドキュメント準備完了イベントを意味します。

<head>セクション内に、$(document).ready();このようなものを配置します。

<head>
    <script type="text/javascript">
        jQuery(document).ready(function() {
            jQuery(".rest_in_place").rest_in_place();
        });
    </script>
</head>

または

<head>
      <script type="text/javascript">
          jQuery(function() {
               jQuery(".rest_in_place").rest_in_place();
          });
      </script>
</head>
于 2010-10-22T21:24:07.153 に答える
0

著者はおそらく、DOM(ドキュメントの階層構造)が完全にロードされたときに実行されるjQueryレディハンドラーを意味していました。

JavaScriptコードは次のようになります

$(document).ready(function() {
    $(".rest_in_place").rest_in_place();
});

$これはの同義語であることに注意してくださいjQuery(互換モードを明示的に有効にしない限り)。

于 2010-10-22T21:24:43.223 に答える