プラグインを使用してほとんどのモデルをインラインで編集可能にしたいのですが、次のことがわかりません。
これを使用するには、テンプレートにjquery.rest_in_place.jsを含め、ドキュメントのonLoadハンドラーで次のコマンドを実行します。
jQuery( "。rest_in_place")。rest_in_place();
http://jan.varwig.org/projects/rest-in-place
これはどこに置きますか?
プラグインを使用してほとんどのモデルをインラインで編集可能にしたいのですが、次のことがわかりません。
これを使用するには、テンプレートにjquery.rest_in_place.jsを含め、ドキュメントのonLoadハンドラーで次のコマンドを実行します。
jQuery( "。rest_in_place")。rest_in_place();
http://jan.varwig.org/projects/rest-in-place
これはどこに置きますか?
それらはおそらく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>
著者はおそらく、DOM(ドキュメントの階層構造)が完全にロードされたときに実行されるjQueryレディハンドラーを意味していました。
JavaScriptコードは次のようになります
$(document).ready(function() {
$(".rest_in_place").rest_in_place();
});
$
これはの同義語であることに注意してくださいjQuery
(互換モードを明示的に有効にしない限り)。