javascript - 多个脚本不起作用

标签 javascript jquery

我创建了两个 jquery 和脚本来构建日历确认..但是当它们位于单独的 html 页面中时它运行良好..但是当两个脚本位于同一页面中时它不起作用..这是为什么?

    <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">

/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>
<script type="text/javascript">
//Datechooser_____________________
window.onload = function(){
new JsDatePick({
            useMode:2,
            target:"date_created_text",
            dateFormat:"%Y-%m-%d"

        });

        new JsDatePick({
            useMode:2,
            target:"date_retained_text",
            dateFormat:"%Y-%m-%d"

        });

        new JsDatePick({
            useMode:2,
            target:"date_to_be_disposed_text",
            dateFormat:"%Y-%m-%d"

        });

}
</script>


<script type="text/javascript">

var mygallery=new fadeSlideShow({
    wrapperid: "slide", //ID of blank DIV on page to house Slideshow
    dimensions: [967, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
    imagearray: [
        ["images/img0.jpg", "", "", "The best way to track your files"],
        ["images/img1.jpg", "", "", "The choice for quality service"],
        ["images/img2.jpg", "", "", "With latest technology"],
        ["images/img3.jpg","","","For a safe and secured place"],
        ["images/img4.jpg", "", "", "Better performance with reliable service"],
        ["images/img5.jpg", "", "", "24 x 7 Service"]

         //<--no trailing comma after very last image element!
    ],
    displaymode: {type:'auto', pause:5000, cycles:0, wraparound:false},
    persist:  false, //remember last viewed slide and recall within same session?
    fadeduration: 1500, //transition duration (milliseconds)
    descreveal: "peekaboo",
    togglerid: ""
})




</script>
<script type="text/javascript">
function Blank_TextField_Validator()
{
// Check the value of the element named text_name from the form named text_form
//if (text_form.text_name.value == "")
if(form1.legacy_code_text.value=="" && form1.lable_title_text.value=="" && form1.file_name_text.value=="" && form1.bundle_ref_no_text.value=="" &&form1.bundle_shelf_no_text.value=="" && form1.rack_no_text.value=="" && form1.shelf_no_text.value=="" &&form1.date_created_text.value=="" && form1.date_retained_text.value=="" && form1.date_to_be_disposed_text.value=="" && form1.division_list.value==-1  && form1.unit_list.value==-1 && form1.assignee_code_list.value==-1 && form1.assignee_list.value==-1 && form1.subject_list.value==-1 && form1.serial_no_list.value==-1)
{
  // If null display and alert box
   alert("You have to have even one searching criteria to search files !");
  // Place the cursor on the field for revision

  // return false to stop further processing
   return (false);
}
// If text_name is not null continue processing
return (true);
}
</script>

最佳答案

仅保留这一行:

<script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>

并删除以下行:

<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript" src="jsdatepick-calendar/jquery.1.4.2.js"></script>

在页面内调用 jQuery 库的次数不能超过 1 次。

希望这有效......穆罕默德。

关于javascript - 多个脚本不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11501961/

相关文章:

javascript - ExpressJS 中的嵌套路由

jquery - 如何使用 jQuery 删除/取消设置一些获取参数并刷新

javascript - 哈希登录 jQuery 调用

javascript - 如何将 reCAPTCHA 设为必填字段?

javascript - 当变量名称较小时,浏览器会更快地处理 javascript 函数吗?

javascript - ionic - 页面内容仅在单击菜单切换后可见

javascript - 弹出消息不会出现在克隆的对象旁边

c# - Bootstrap 选择下拉加载问题

javascript - 在 FOR 循环中等待上一个 AJAX 调用

javascript - jquery hide 隐藏子菜单内容