【发布时间】:2010-11-21 19:15:40
【问题描述】:
following line中entire page的定义是什么?
当通过 PHP include() 或 require() 包含整个页面时 函数,确保把那个脚本
<body>标签内的代码,而不是 在<head>里面,因为调用 jQuery脚本文件从里面 标签对某些人不起作用 原因。
我在设置 jQuery 代码时遇到了问题。
但是,我设法通过将其放入 HEAD 和以下代码中来使其工作
#1 代码
$(document).ready(function(){
--- code here----
});
我还没有设法让任何功能正常工作。 我在代码 #1 的内部和外部都有它们。下面是一个例子。
#2 不工作的代码
function notEmpty() {
//put this in a function and call it when the user tries to submit
var tags = document.getElementById('tags').value;
if(tags == '' || tags == null) {
alert('Please enter one or more tags');
return false;
}
return true;
}
我使用 PHP 在我的 index.php 中通过以下代码包含标签 HTML、HEAD、/HEAD 和 BODY。
#3 获取 HTML、HEAD 和 body 标签的代码
include ( './official_content/html_head_body.php' );
【问题讨论】:
-
好问题。文档在这里不是很具体。
-
感谢您的回答! - 因为很好的解释,我接受了 Votey 的回答。
标签: javascript jquery head