Javascript 未捕获引用错误:$未定义(匿名函数)$(函数()不工作 .ui日期选择器{字体大小:62.5%;} $(函数(){ $(“#StartDate”).datepicker({dateFormat:'yy-mm-dd}).val(); $(“#EndDate”).datepicker({dateFormat:“yy-mm-dd”}).val(); });
此代码不起作用。$function()不起作用并引发错误。怎么了?应该包括哪些其他jQuery库?看起来像的链接,并且正在引发504。因此出现错误。Javascript 未捕获引用错误:$未定义(匿名函数)$(函数()不工作 .ui日期选择器{字体大小:62.5%;} $(函数(){ $(“#StartDate”).datepicker({dateFormat:'yy-mm-dd}).val(); $(“#EndDate”).datepicker({dateFormat:“yy-mm-dd”}).val(); });,javascript,jquery,Javascript,Jquery,此代码不起作用。$function()不起作用并引发错误。怎么了?应该包括哪些其他jQuery库?看起来像的链接,并且正在引发504。因此出现错误。 https://不起作用 试试这个: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w
https://
不起作用
试试这个:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script language="Javascript" type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script language="Javascript" type="text/javascript" src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style type="text/css">
.ui-datepicker { font-size: 62.5%; }
</style>
<script>
$(function() {
$("#StartDate").datepicker({ dateFormat: "yy-mm-dd" }).val();
$("#EndDate").datepicker({ dateFormat: "yy-mm-dd" }).val();
});
</script>
</head>
<body bgcolor='#6a7c99'>
<input id='StartDate' type='text' style='position:absolute;top:35px;left:92px;width:55px;font-family:arial narrow;font-size:8pt;display:none;' name='StartDate'>
<input id='EndDate' type='text' style='position:absolute;top:75px;left:92px;width:55px;font-family:arial narrow;font-size:8pt;display:none;' name='EndDate'>
</body>
</html>
jQuery未正确加载将https://
更改为//
,它应该可以正常工作。您的协议可能不匹配。https也不工作,因为我的服务器是安全的,并且有SSL证书,它会阻止任何http。但是$(document)。ready(function())工作正常。请建议我怎么做!请建议如何在安全服务器中使用jquery和jquery ui链接!这正是我告诉你的。将所有文件下载到一个包含静态文件的文件夹中。如果你没有创建新文件,请指向该文件夹,而不是当前使用的链接
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script language="Javascript" type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script language="Javascript" type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>