我正在尝试检查我的Jquery库是否已加载到我的HTML页面上。我正在检查它是否有效,但是有些不正确。这是我所拥有的:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="/query-1.6.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
if (jQuery) {
// jQuery is loaded
alert("Yeah!");
} else {
// jQuery is not loaded
alert("Doesn't Work");
}
});
</script>
3
不要在“ $(document).Ready”中使用大写字母R
—
Serigan 2012年
alert(window.$?1:0)
为什么仍使用旧的xhtml标准?请
—
卢克极客
<!doctype html>
改用