2

My domain is:http://princessdannam.com/. I using two scripts one for datepicker and one for scroll. This is for datepicker:

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

<script type="text/javascript">
    // Datepicker
    jQuery(document).ready(function(){
        jQuery("#datepicker" ).datepicker({ minDate: 0});   
        jQuery( "#datepicker" ).datepicker({ dateFormat: 'dd-mm-yy' });

        jQuery("#booking_form").submit(function() {
            var datepickedup = jQuery("input#datepicker").val();
            var adults = jQuery("#adults option:selected").val();
            var nights = jQuery("#nights option:selected").val();
            window.open("https://www.luxuryroomreservations.com/en-GB/IBE/234/Room/Availability?StartDate="+datepickedup+"&NoOfAdults="+adults+"&NoOfChildren=0&NoOfNights="+nights+"&HotelCode=HUPHHPD", "_blank");
            return false;
        });


    });
</script>

This is for scroll:

    <script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('.ubermenu-submenu li').find('a').click(function(){
        var $url = jQuery(this).attr('href');
        var hash = $url.substring($url.indexOf('#')+1);
        var $anchor = jQuery('#'+$url).offset();
        window.scrollTo($anchor.left,$anchor.top);


        });
    });
</script>

When I add <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>, then datepicker stopped working, and if I remove this scroll query stopped working and also other pages animation stopped working.

Please help me out to resolve this issue. Thank You.

Nemo
  • 2,441
  • 2
  • 29
  • 63
Nisha Sharma
  • 245
  • 1
  • 2
  • 13
  • Do you know $.noConflict() – guvenckardas Sep 16 '15 at 11:19
  • there should not be any issue if you don't have references of different versions of jQuery. – Jai Sep 16 '15 at 11:24
  • @guvenckardas Yes, I have already used jQuery.noConflict(), but its not worked. I have also used with variable but nothing happened. – Nisha Sharma Sep 16 '15 at 11:29
  • @jai But I'm getting this issue. – Nisha Sharma Sep 16 '15 at 11:31
  • run this in console: `$.fn.jquery` and show the result comming, this will let you see what version of jquery is actually used on the page. – Jai Sep 16 '15 at 11:39
  • You used noConflict but I think still using jQuery. You need tou use var x = $.noConflict() and x(datepicker) or etc. – guvenckardas Sep 16 '15 at 11:48
  • 1
    WordPress already includes jQuery and jQuery-UI. I'm not sure why you're including it again. – rnevius Sep 16 '15 at 12:00
  • @guvenckardas I have updated this jquery, but its not working. – Nisha Sharma Sep 16 '15 at 12:01
  • possible duplicate of [TypeError: 'undefined' is not a function (evaluating '$(document)')](http://stackoverflow.com/questions/7975093/typeerror-undefined-is-not-a-function-evaluating-document) – rnevius Sep 16 '15 at 12:02
  • @rnevius I know but when I remove this jquery, my calander is not working. So, I have included it and added script into footer file. – Nisha Sharma Sep 16 '15 at 12:03
  • @NishaSharma you need to use if for datepicker – guvenckardas Sep 16 '15 at 12:03
  • – guvenckardas Sep 16 '15 at 12:05
  • @rnevius I have used all the possibilties for this but nothing worked for me. When I use It give an error $ is not a function, but my scroll works. But other pages animation or plugins stopped working. – Nisha Sharma Sep 16 '15 at 12:06
  • @guvenckardas I have added that script, now my calander stopped working. – Nisha Sharma Sep 16 '15 at 12:13
  • @NishaSharma could we try on jsfiddle? – guvenckardas Sep 16 '15 at 12:13
  • @guvenckardas I have tried on jsfiddle and its working, but not in my site. – Nisha Sharma Sep 16 '15 at 12:16
  • @NishaSharma you can put in github your project and share so we can solve that – guvenckardas Sep 16 '15 at 12:17
  • @guvenckardas This is not my project. Its my clients project. – Nisha Sharma Sep 16 '15 at 12:22
  • From jQuery.scrollTo readme : "The plugin requires jQuery 1.8 or higher.". – vard Sep 16 '15 at 13:16
  • @vard I have include script and its working for scroll, but contact page animation or plugins stopped working. – Nisha Sharma Sep 17 '15 at 04:08
  • 1
    I see this error in the console on your site: You have included the Google Maps API multiple times on this page. This may cause unexpected errors. – ThemesCreator Oct 14 '15 at 14:25

0 Answers0