Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 什么是Rails中的文档onLoad hander?_Jquery_Ruby On Rails_Edit In Place - Fatal编程技术网

Jquery 什么是Rails中的文档onLoad hander?

Jquery 什么是Rails中的文档onLoad hander?,jquery,ruby-on-rails,edit-in-place,Jquery,Ruby On Rails,Edit In Place,我想使用插件使我的大多数模型可以在线编辑,但我不了解以下内容: 要使用它,请包括 jquery.rest\u in\u place.js在 模板,并在中执行以下操作 文档的onLoad处理程序: jQuery(“.rest_in_place”).rest_in_place() 我应该把它放在哪里?它们可能是指jQuery文档就绪事件 在部分中,放置一个$(document).ready()像这样 <head> <script type="text/javascript

我想使用插件使我的大多数模型可以在线编辑,但我不了解以下内容:

要使用它,请包括 jquery.rest\u in\u place.js在 模板,并在中执行以下操作 文档的onLoad处理程序:

jQuery(“.rest_in_place”).rest_in_place()


我应该把它放在哪里?

它们可能是指jQuery文档就绪事件

部分中,放置一个
$(document).ready()像这样

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

jQuery(文档).ready(函数(){
jQuery(“.rest_in_place”).rest_in_place();
});

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

jQuery(函数(){
jQuery(“.rest_in_place”).rest_in_place();
});

它们可能是指jQuery文档就绪事件

部分中,放置一个
$(document).ready()像这样

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

jQuery(文档).ready(函数(){
jQuery(“.rest_in_place”).rest_in_place();
});

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

jQuery(函数(){
jQuery(“.rest_in_place”).rest_in_place();
});

作者可能指的是当DOM(文档的层次结构)完全加载时执行的jQuery处理程序

您的JavaScript代码应该如下所示

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

请注意,
$
jQuery
的同义词(除非明确启用兼容模式)。

作者可能指的是当DOM(文档的层次结构)完全加载时执行的jQuery处理程序

您的JavaScript代码应该如下所示

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

请注意,
$
jQuery
的同义词(除非明确启用兼容模式)。

JavaScript现在运行时没有
标记?:)最好将JavaScript代码与HTML分开,换句话说,包含一个.js文件,而不是将其放入.js文件中。绝对:)并且
应该是小写的。坚持标准,伙计:p@Nick-这只是一个发现错误的案例。在您出现之前,没有人注意到,所以它起了作用:pJavaScript现在运行时没有
标记?:)最好将JavaScript代码与HTML分开,换句话说,包含一个.js文件,而不是将其放入.js文件中。绝对:)并且
应该是小写的。坚持标准,伙计:p@Nick-这只是一个发现错误的案例。在你出现之前没有人注意到,所以它起了作用:p