如何在一个页面中使用2个jquery版本相同 [英] how to use 2 jquery version in one page same
问题描述
如何同时使用JQuery
< title>< / title>
< ; script type =text / javascriptsrc =https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js>< / script>
< link rel =stylesheethref =// ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css/>
< script type =text / javascriptsrc =https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js>< / script> ;
< script type =text / javascript>< / script>
< script type =text / javascript>
/ *创建需要禁用的天数* /
var array = [2015-12-30,2015-11 -26,2016-01-01]
$(文件).ready(function(){
$('#googleJqueryDate')。datepicker({
beforeShowDay:function(date){
var string = jQuery.datepicker.formatDate('yy-mm-dd',date);
return [array.indexOf(string)== -1]
}
});
});
< / script>
< script>
$(document).ready(function(){
// $ .datepicker.setDefaults({dateFormat:'dd / M / yy'});
$('。googleJqueryDate')。datepicker({
dateFormat: 'dd / M / yy'
//,maxDate:+ 1M + 10D
,minDate:0
,beforeShowDay:getMasterKuldeepLogic
,showWeek:true
});
$(' .googleJqueryDate')。attr(onkeyup,return false;);
$('。googleJqueryDate')。attr(onkeydown,return fals e;);
$('。googleJqueryDate')。attr(onPaste,return false;);
函数getMasterKuldeepLogic(todaydate){
var firstday = new Date(todaydate.getFullYear(),todaydate.getMonth(),1).getDay();
var noOfWeek = Math.ceil((todaydate.getDate()+ firstday)/ 7);
if(todaydate.getDay()== 0){return [false]; }
else if(noOfWeek == 2 || noOfWeek == 4){
if(todaydate.getDay()== 6){return [false]; }
else {return [true]; }
}
else {return [true]; }
}
});
< / script>
How To Work Both JQuery
<title></title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet"href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script type="text/javascript"></script>
<script type="text/javascript">
/* create an array of days which need to be disabled */
var array = ["2015-12-30", "2015-11-26", "2016-01-01"]
$(document).ready(function () {
$('#googleJqueryDate').datepicker({
beforeShowDay: function (date) {
var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
return [array.indexOf(string) == -1]
}
});
});
</script>
<script>
$(document).ready(function () {
//$.datepicker.setDefaults({ dateFormat: 'dd/M/yy' });
$('.googleJqueryDate').datepicker({
dateFormat: 'dd/M/yy'
//,maxDate: "+1M +10D"
, minDate: 0
, beforeShowDay: getMasterKuldeepLogic
, showWeek: true
});
$('.googleJqueryDate').attr("onkeyup", "return false;");
$('.googleJqueryDate').attr("onkeydown", "return false;");
$('.googleJqueryDate').attr("onPaste", "return false;");
function getMasterKuldeepLogic(todaydate) {
var firstday = new Date(todaydate.getFullYear(), todaydate.getMonth(), 1).getDay();
var noOfWeek = Math.ceil((todaydate.getDate() + firstday) / 7);
if (todaydate.getDay() == 0) { return [false]; }
else if (noOfWeek == 2 || noOfWeek == 4) {
if (todaydate.getDay() == 6) { return [false]; }
else { return [true]; }
}
else { return [true]; }
}
});
</script>
推荐答案
(document).ready(function(){
(document).ready(function () {
('#googleJqueryDate')。datepicker ({
beforeShowDay:function(date){
var string = jQuery.datepicker.formatDate('yy-mm-dd',date);
返回[array.indexOf(string)== -1]
}
});
});
< / script>
< script>
('#googleJqueryDate').datepicker({
beforeShowDay: function (date) {
var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
return [array.indexOf(string) == -1]
}
});
});
</script>
<script>
(document).ready(function(){
//
(document).ready(function () {
//
这篇关于如何在一个页面中使用2个jquery版本相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!