本文介绍了当我向html页面添加两个脚本时..一个不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了两个jquery和脚本标签来压缩确认..但是当它们处于单独的html页面时它运行良好..但是当两个脚本在同一页面时它不起作用..为什么?
I created two jquery and and script tags to calender an confirmation ..but when they are in seperate html pages it works well..but it doesnt work when the two scripts are in the same page..Why is that?
<script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.21.custom.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$('#click').click(function(){
//$(function() {
// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-confirm" ).dialog({
resizable: false,
height:140,
modal: true,
buttons: {
"Ok": function() {
$('#form1').submit();
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
});
});
</script>
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript" src="jsdatepick-calendar/jquery.1.4.2.js"></script>
<script type="text/javascript" src="jsdatepick-calendar/jsDatePick.jquery.min.1.3.js"></script>
<script type="text/javascript" src="jquery/fadeslideshow.js"></script>
推荐答案
看看jQueries没有冲突。
Have a look at jQueries no conflict.http://api.jquery.com/jQuery.noConflict/
这使得你可以使用来自不同jQuery版本/库的某些函数。
This makes it so you can use certain functions from different jQuery versions/libraries.
这篇关于当我向html页面添加两个脚本时..一个不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!