Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.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
Javascript jquery的Ready函数_Javascript_Jquery_Html_Document Ready - Fatal编程技术网

Javascript jquery的Ready函数

Javascript jquery的Ready函数,javascript,jquery,html,document-ready,Javascript,Jquery,Html,Document Ready,我正在使用一个非常简单的jquery更改段落文本,但它不起作用。请帮忙 <script type="text/javascript"> $(document).ready(function(){ $("p").text("The DOM is now loaded and can be manipulated."); }); </script> </head> <body> <p>This is a paragraph.&l

我正在使用一个非常简单的jquery更改段落文本,但它不起作用。请帮忙

<script type="text/javascript">
$(document).ready(function(){

   $("p").text("The DOM is now loaded and can be manipulated.");


});
</script>
</head>
<body>
<p>This is a paragraph.</p>
</body>
</html>
很抱歉没有先学习JQUERY,我直接跳到了代码,不知道它也需要一个单独的JQUERY文件。

<script type="text/javascript">
$(document).ready(function(){

   $("p").text("The DOM is now loaded and can be manipulated.");


});
</script>
</head>
<body>
<p>This is a paragraph.</p>
</body>
</html>

$(文档).ready(函数(){
$(“p”).text(“DOM现在已加载,可以进行操作。”);
});
这是一段

<script type="text/javascript">
$(document).ready(function(){

   $("p").text("The DOM is now loaded and can be manipulated.");


});
</script>
</head>
<body>
<p>This is a paragraph.</p>
</body>
</html>
您在页面中没有,因此
$
未定义的

添加jquery库

<script type="text/javascript">
$(document).ready(function(){

   $("p").text("The DOM is now loaded and can be manipulated.");


});
</script>
</head>
<body>
<p>This is a paragraph.</p>
</body>
</html>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>


我没有看到您在其中包含jQuery脚本?它在我这边起作用。您确定已包含jquery库吗?如果您添加了jquery,您应该发布完整的代码以获得正确的解析:)在编写javascript时,您必须学习如何查看浏览器的错误控制台或调试器控制台,以便查看javascript错误的位置。然后,这样的错误对您来说会更加明显。堆栈溢出不能代替远程尝试读取jquery文档。如果你看不懂引言的第一段,请不要提问