trentrichardson datetimepicker and timepicker doesn't work

谁说我不能喝 提交于 2019-12-11 03:43:22

问题


For the trentrichardson timepicker addon (http://trentrichardson.com/examples/timepicker/) for datetimepicker and timepicker, it seems to work for a limited amount of time (6 hours to a day), THEN, it stops working. TO FIX THIS, I replace the addon CDN (http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js), for the same one, and it works again.

How could this be? I put the CDN's in the correct order as well...

  1. jQuery
  2. jQueryUI (with datepicker and slider wigits)
  3. Timepicker
  4. Then CSS

P.S. I removed my main.css file and corresponding class="" from the inputs.

Once again, it works for 6 hours to a day, then stops working... with nothing changing. And I'm pretty sure the CDN's are not changing either, but they may be, but that should not matter since the file path itself is not changing. Let me know what you think, thanks! ALSO, when it stops working, I checked the file paths and they are still valid.

Code:

<!doctype html>
<html>
<head>

<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>  
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js"></script>
<link rel="stylesheet" href="http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.css">

<script> 
$(function() {
    $( "#datetimepicker" ).datetimepicker();
});

$(function() {
    $( "#timepicker" ).timepicker();
});
</script>
</head>

<body>
</body>
</html>

<?php
echo '<input type="text" id="datetimepicker" size="12px">';
echo '<input type="text" id="timepicker" size="2px">';
?>

回答1:


Trent Richardson has explicitly started preventing hotlinks to his site as of last year:

http://trentrichardson.com/2012/09/27/no-more-hotlinking/

Your hotlinks may only work sporadically, or may not work at all.

You should use jsdeliver.com (which hosts his timepicker plugin) or find another CDN.



来源:https://stackoverflow.com/questions/16657625/trentrichardson-datetimepicker-and-timepicker-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!