无法让 Any+Time 日期选择器工作

发布于 2024-10-21 22:23:57 字数 1793 浏览 2 评论 0原文

嘿,我尝试使用 Any+Time 日期选择器,用 java 脚本编写,并在其下载网站 (http: //www.ama3.com/anytime/)但不知何故无法让它工作。现在,它只显示纯文本框。 有人可以告诉我在查看下面的 html 页面后我做错了什么吗?

<html>
<head>
<title>My page</title>
<link rel="stylesheet" type="text/css" href="/anytime.css" />
<script type="text/javascript" src="/jquery-1.4.2.min"></script>
<script type="text/javascript" src="/anytime.js"></script>
</head>
<body>
<style type="text/css">
  #field2 { background-image:url("clock.jpg");
    background-position:right center; background-repeat:no-repeat;
    border:1px solid #FFC030;color:#3090C0;font-weight:bold}
  #AnyTime--field2 {background-color:#EFEFEF;border:1px solid #CCC}
  #AnyTime--field2 * {font-weight:bold}
  #AnyTime--field2 .AnyTime-btn {background-color:#F9F9FC;
    border:1px solid #CCC;color:#3090C0}
  #AnyTime--field2 .AnyTime-cur-btn {background-color:#FCF9F6;
      border:1px solid #FFC030;color:#FFC030}
  #AnyTime--field2 .AnyTime-focus-btn {border-style:dotted}
  #AnyTime--field2 .AnyTime-lbl {color:black}
  #AnyTime--field2 .AnyTime-hdr {background-color:#FFC030;color:white}
</style>
<div id="content"><h1>Any time</h1><br /><br/>
Date: <input type="text" id="field1" size="50"
    value="Sunday, March 13th in the Year 2011 CE" /><br/>
Time: <input type="text" id="field2" value="12:34" />
<script type="text/javascript">
  $("#field1").AnyTime_picker( { format: "%W, %M %D in the Year %z %E", firstDOW: 1 } );
  $("#field2").AnyTime_picker( { format: "%H:%i", labelTitle: "Hour", labelHour: "Hour", labelMinute: "Minute" } );
</script>
</div>
</body>
</html>

Hey I tried to use Any+Time date picker, written in java script with the tutorial offered at its download website (http://www.ama3.com/anytime/) but somehow can't get it to work. Right now, it displays nothing more than plain text box.
Can someone tell me what am I doing wrong after looking at the html page below?

<html>
<head>
<title>My page</title>
<link rel="stylesheet" type="text/css" href="/anytime.css" />
<script type="text/javascript" src="/jquery-1.4.2.min"></script>
<script type="text/javascript" src="/anytime.js"></script>
</head>
<body>
<style type="text/css">
  #field2 { background-image:url("clock.jpg");
    background-position:right center; background-repeat:no-repeat;
    border:1px solid #FFC030;color:#3090C0;font-weight:bold}
  #AnyTime--field2 {background-color:#EFEFEF;border:1px solid #CCC}
  #AnyTime--field2 * {font-weight:bold}
  #AnyTime--field2 .AnyTime-btn {background-color:#F9F9FC;
    border:1px solid #CCC;color:#3090C0}
  #AnyTime--field2 .AnyTime-cur-btn {background-color:#FCF9F6;
      border:1px solid #FFC030;color:#FFC030}
  #AnyTime--field2 .AnyTime-focus-btn {border-style:dotted}
  #AnyTime--field2 .AnyTime-lbl {color:black}
  #AnyTime--field2 .AnyTime-hdr {background-color:#FFC030;color:white}
</style>
<div id="content"><h1>Any time</h1><br /><br/>
Date: <input type="text" id="field1" size="50"
    value="Sunday, March 13th in the Year 2011 CE" /><br/>
Time: <input type="text" id="field2" value="12:34" />
<script type="text/javascript">
  $("#field1").AnyTime_picker( { format: "%W, %M %D in the Year %z %E", firstDOW: 1 } );
  $("#field2").AnyTime_picker( { format: "%H:%i", labelTitle: "Hour", labelHour: "Hour", labelMinute: "Minute" } );
</script>
</div>
</body>
</html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

挽你眉间 2024-10-28 22:23:57

您在尝试加载 jQuery 的脚本标记中的 /jquery-1.4.2.min 之后缺少 .js。

You're missing .js after /jquery-1.4.2.min in your script tag trying to load jQuery.

剧终人散尽 2024-10-28 22:23:57

我真的不确定这是否是我的错误,或者我从 Any + Time Date picker 网站下载的 jquery 文件是否有问题。从 jquery 官方网站下载 jquery 后,一切正常。

Andrew M. Andrews III,您能检查一下您网站上下载的 jquery-1.4.2.min.js 是否仍然可以正常工作吗?我可能是错的,但值得测试一下。

感谢大家花时间帮助我。

问候,
血清素追逐

I'm really not sure if it was a mistake on my part or whether the jquery file I downloaded from the Any + Time Date picker website had a problem. After I downloaded jquery from the official jquery website everything works fine.

So Andrew M. Andrews III, can you check if the jquery-1.4.2.min.js downloadable at your website still works fine? I may be wrong but its worth testing it out.

Thanks everyone for your time in helping me out.

Regards,
SerotoninChase

明明#如月 2024-10-28 22:23:57

试试这个:

$(document).ready(function(){
 $("#field1").AnyTime_picker( { format: "%W, %M %D in the Year %z %E", firstDOW: 1 } );
  $("#field2").AnyTime_picker( { format: "%H:%i", labelTitle: "Hour", labelHour: "Hour", labelMinute: "Minute" } );
});

Try this:

$(document).ready(function(){
 $("#field1").AnyTime_picker( { format: "%W, %M %D in the Year %z %E", firstDOW: 1 } );
  $("#field2").AnyTime_picker( { format: "%H:%i", labelTitle: "Hour", labelHour: "Hour", labelMinute: "Minute" } );
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文