javascript - I can't use multiple jquery versions -
this question has answer here:
i want use 2 different jquery version on 1 page codes:
<!----- mobile menu starts -----> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="style/mobile_menu.css"> <script type="text/javascript"> var jquery_1_11_0 = $.noconflict(true); </script> <!----- mobile menu ended -----> <!------ post slide starts ------> <link rel="stylesheet" type="text/css" href="./style/post_slide_style.css"> <script src="js/jquery.v1.5.1.min.js"></script> <script type="text/javascript"> var jquery_1_5_1 = $.noconflict(true); </script> <script type="text/javascript" src="./js/jquery.colorbox.js"></script> <script> jquery_1_5_1(document).ready(function(){ jquery_1_5_1("a.gallery").colorbox({rel:'gallery'}); jquery_1_5_1("a.dbox").colorbox({iframe:true, width:"480", height:"580"}); }); </script> <!------ post slide ended ------->
the mobile menu work post slide isn't work helping
the main problem passing true
both noconflict
calls.
jquery.noconflict( [removeall ] )
removeall
type: boolean
boolean indicating whether remove jquery variables global scope (including jquery itself).
so after calls code has not access $
nor jquery
should getting errors in console.
if want use second version of jquery remove true
noconflict
call.
in general, though, bad sign when must use 2 versions of jquery in same page.
Comments
Post a Comment