MyBB Community Forums

Full Version: Question about jQuery.noConflict();
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Is better to write code in this manner

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>jQuery.noConflict();</script>
<script src="{$mybb->settings['bburl']}/jscripts/jquery.cookie.js"></script>
<script>jQuery.noConflict();</script>
<script src="{$mybb->settings['bburl']}/jscripts/tipsy.js"></script>
<script>jQuery.noConflict();</script>

or in this manner?

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>jQuery.noConflict();</script>
<script src="{$mybb->settings['bburl']}/jscripts/jquery.cookie.js"></script>
<script src="{$mybb->settings['bburl']}/jscripts/tipsy.js"></script>

or in this manner?

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="{$mybb->settings['bburl']}/jscripts/jquery.cookie.js"></script>
<script src="{$mybb->settings['bburl']}/jscripts/tipsy.js"></script>
<script>jQuery.noConflict();</script>

Thanks
The second one. no-conflict should be just after adding the library.
You may also add fallback for good practice. This way:
http://demonate.com/thread-773.html
All right, thanks effone