I'm trying to use the jQuery Datepicker and a JavaCcript scrollbar on one page. But if I declare both in the header file one does not work, is there a way I can fix this but still use both? I've tried the following but to no success:
var $j = jQuery.noConflict();
$j("#datepicker").datepicker();
Guido Gautier
1,2239 silver badges13 bronze badges
asked May 8, 2012 at 12:25
Lappies
9232 gold badges11 silver badges30 bronze badges
-
1magic word :) no conflict : api.jquery.com/jQuery.noConflictGrunf– Grunf2012年05月08日 12:28:28 +00:00Commented May 8, 2012 at 12:28
3 Answers 3
try :
jQuery.noConflict();
jQuery("#datepicker").datepicker();
answered May 8, 2012 at 12:27
mgraph
15.3k4 gold badges43 silver badges76 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
You can resolve conflict and still use $ like this:
jQuery(function($){
$("#datepicker").datepicker();
})(jQuery)
answered May 8, 2012 at 12:36
Sarfraz
384k81 gold badges561 silver badges613 bronze badges
Comments
<script src="prototype.js"></script>
<script src="effects.js"></script>
<script src="jquery.js"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($){
jQuery("a").click(function(){
//Effect.Shake('shake_demo');//this is prototype.js function
//jQuery("#datepicker").datepicker();//for suing Jquery function
});
});
</script>
<body>
<div id="shake_demo" style="width:150px; height:40px; background:#ccc; text-align:center;">
<a href="#" style="line-height:40px;">Click me to shake!</a>
</div>
<a id="aClick" class="aClick" href="#" style="line-height:40px;">Click me to shake!</a>
</body>
answered May 8, 2012 at 12:33
Ankur Verma
5,93316 gold badges62 silver badges95 bronze badges
Comments
lang-js