reflex84 Posted May 26, 2011 Report Share Posted May 26, 2011 Hi,I have developed a website but there are 2 javascript codes that are conflicting each other. Only 1 works depending on which javascript code is below the other.1 script is a datepicker and the other script is a digital clock.The Javascript code for the datepicker is: <link rel="stylesheet" href="datepicker/development-bundle/themes/base/jquery.ui.all.css"> <script src="datepicker/development-bundle/jquery-1.5.1.js"></script> <script src="datepicker/development-bundle/ui/jquery.ui.core.js"></script> <script src="datepicker/development-bundle/ui/jquery.ui.widget.js"></script> <script src="datepicker/development-bundle/ui/jquery.ui.datepicker.js"></script> <link rel="stylesheet" href="datepicker/development-bundle/demos/demos.css"> <script> $(function() { $( "#datepicker, #datepicker2, #datepicker3, #datepicker4, #datepicker5, #datepicker6, #datepicker7, #datepicker8, #datepicker9, #datepicker10, #datepicker11, #datepicker12" ).datepicker({ numberOfMonths: 3, showButtonPanel: true }); }); </script> Just below the datepicker script is the digital clock script: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script> <script src="jquery.MyDigitclock.js"></script><script> $(function(){ $("#clock1").MyDigitClock(); $("#clock2").MyDigitClock({ fontSize:50, fontFamily:"Arial", fontColor: "#000", fontWeight:"bold", bAmPm:true, background:'#fff', bShowHeartBeat:true }); $("#clock3").MyDigitClock({ fontSize:150, fontColor:"grey", background:"#fff", fontWeight:"bold", timeFormat: '{HH}<span id="ch1">:</span>{MM}'} ); }); </script> How can I make it so that both scripts are working??I've done some research resolve the problem but I need elaborate answers, please (as I'm not very knowledgeable at javascript)Thanks guys! Link to comment Share on other sites More sharing options...
jeffman Posted May 26, 2011 Report Share Posted May 26, 2011 (edited) The first debugging step is to see what kind of errors occur. I prefer the Firefox Error Console (versions < 4) or Web Console (4+). Even if you don't understand the error yourself, you can post the error here, and that might help someone else to figure out the problem.Look at my Member Profile for instructions on using Web Console. Edited May 26, 2011 by Deirdre's Dad Link to comment Share on other sites More sharing options...
reflex84 Posted May 26, 2011 Author Report Share Posted May 26, 2011 Thanks for the quick reply ...I looked at the error console and it out of this code: <link rel="stylesheet" href="datepicker/development-bundle/themes/base/jquery.ui.all.css"> <script src="datepicker/development-bundle/jquery-1.5.1.js"></script> <script src="datepicker/development-bundle/ui/jquery.ui.core.js"></script> <script src="datepicker/development-bundle/ui/jquery.ui.widget.js"></script> <script src="datepicker/development-bundle/ui/jquery.ui.datepicker.js"></script> <link rel="stylesheet" href="datepicker/development-bundle/demos/demos.css"> <script> $(function() { $( "#datepicker, #datepicker2, #datepicker3, #datepicker4, #datepicker5, #datepicker6, #datepicker7, #datepicker8, #datepicker9, #datepicker10, #datepicker11, #datepicker12" ).datepicker({ numberOfMonths: 3, showButtonPanel: true }); }); </script><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script> <script src="jquery.MyDigitclock.js"></script><script> $(function(){ $("#clock1").MyDigitClock(); $("#clock2").MyDigitClock({ fontSize:50, fontFamily:"Arial", fontColor: "#000", fontWeight:"bold", bAmPm:true, background:'#fff', bShowHeartBeat:true }); $("#clock3").MyDigitClock({ fontSize:150, fontColor:"grey", background:"#fff", fontWeight:"bold", timeFormat: '{HH}<span id="ch1">:</span>{MM}'} ); }); </script> This is the code it highlights: showButtonPanel: true Any ideas?Thanks ... Link to comment Share on other sites More sharing options...
thescientist Posted May 28, 2011 Report Share Posted May 28, 2011 but what is the error? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now