2012-07-16 209 views
0

我创建了两个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> 
+0

可能重复[当我添加两个脚本到一个HTML页面..一个是不工作](http://stackoverflow.com/questions/11501412/when-i-add-two-scripts-toa-a- html-page-one-is-doesnt-work) – arttronics 2012-07-16 10:10:19

回答

2

只保留此行:

<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次。

希望这项工程...穆罕默德。

+0

仍然在努力工作! – Lahi2010 2012-07-16 09:59:40

+0

仍然无法正常工作:( – Lahi2010 2012-07-16 10:04:57

+0

我尝试了很多..还没有工作! – Lahi2010 2012-07-16 10:07:51