简体   繁体   English

JQUERY UI DatePicker日历未显示

[英]JQUERY UI DatePicker Calendar not showing

I was working on JQuery UI Date Picker. 我正在研究JQuery UI Date Picker。

before it was working great but now the calendar won't show up. 在它运作良好之前,但现在日历不会出现。 any ideas? 有任何想法吗?

here's my code. 这是我的代码。 http://pastebin.com/L4j2TmyY http://pastebin.com/L4j2TmyY

my code is too long so i placed it in pastebin. 我的代码太长了所以我把它放在pastebin中。

I follow this exactly but calendar is not showing http://jqueryui.com/datepicker/ 我完全遵循这个,但日历没有显示http://jqueryui.com/datepicker/

As i saw your pastebin you are loading two jQuery libraries, which is not recommended, although you can use it with jQuery.noConflict() . 正如我看到你的pastebin你正在加载两个jQuery库,这是不推荐的,虽然你可以使用它与jQuery.noConflict() So the quick fix is this: 所以快速修复是这样的:

Remove this library: 删除此库:

<script src="//code.jquery.com/jquery-1.10.2.js"></script>

I think you should download all the JavaScript files into your project folder and call the JavaScript files. 我认为您应该将所有JavaScript文件下载到项目文件夹中并调用JavaScript文件。

Example : 示例:

Calling JavaScript from external URL (Not working) 从外部URL调用JavaScript(不工作)

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>undelegate demo</title>
  <style>
  button {
    margin: 5px;
  }
  button#theone {
    color: red;
    background: yellow;
  }
  </style>
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>

<button id="theone">Does nothing...</button>
<button id="bind">Bind Click</button>
<button id="unbind">Unbind Click</button>
<div style="display:none;">Click!</div>

<script>
function aClick() {
  $( "div" ).show().fadeOut( "slow" );
}
$( "#bind" ).click(function() {
  $( "body" )
    .delegate( "#theone", "click", aClick )
    .find( "#theone" ).text( "Can Click!" );
});
$( "#unbind" ).click(function() {
  $( "body" )
    .undelegate( "#theone", "click", aClick )
    .find( "#theone" ).text( "Does nothing..." );
});
</script>

</body>
</html>

Calling from project Folder(Working fine) 从项目文件夹调用(工作正常)

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>undelegate demo</title>
  <style>
  button {
    margin: 5px;
  }
  button#theone {
    color: red;
    background: yellow;
  }
  </style>
  <script src="jQuery.js"></script>
</head>
<body>

<button id="theone">Does nothing...</button>
<button id="bind">Bind Click</button>
<button id="unbind">Unbind Click</button>
<div style="display:none;">Click!</div>

<script>
function aClick() {
  $( "div" ).show().fadeOut( "slow" );
}
$( "#bind" ).click(function() {
  $( "body" )
    .delegate( "#theone", "click", aClick )
    .find( "#theone" ).text( "Can Click!" );
});
$( "#unbind" ).click(function() {
  $( "body" )
    .undelegate( "#theone", "click", aClick )
    .find( "#theone" ).text( "Does nothing..." );
});
</script>

</body>
</html>

@Kim Carlo @Kim Carlo

I continue with @Rohit Bandooni's answer. 我继续@Rohit Bandooni的回答。

As his answer, it should work correctly. 作为他的答案,它应该正常工作。

A pastebin cloned from your paste: http://pastebin.com/2yNiXy44 I did some changes: - comment yours 2 "die" - change the method name (search for text "CHANGE_BY_ME" in pastebin) 从您的粘贴克隆的pastebin: http//pastebin.com/2yNiXy44我做了一些更改: - 评论你的2“死” - 更改方法名称(在pastebin中搜索文本“CHANGE_BY_ME”)

I run on my EasyPHP, it works well: http://imgur.com/kfmLkLY,lHsEUyv (2 images for 2 controls) I found only 2 date controls on your page. 我在我的EasyPHP上运行,效果很好: http//imgur.com/kfmLkLY,lHsEUyv (2个控件的2个图像)我在你的页面上只找到了2个日期控件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM