1

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();
1

3 Answers 3

2

try :

jQuery.noConflict();
jQuery("#datepicker").datepicker();
1

You can resolve conflict and still use $ like this:

jQuery(function($){
    $("#datepicker").datepicker();
})(jQuery)
1
<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>

Not the answer you're looking for? Browse other questions tagged or ask your own question.