0

I need to use two different versions of jQuery on my website. Because i need to use one plugin that is using different version of jQuery than my site. I tried to use noConflict and i even made that plugin to work, but my site didnt work properly. Any idea?

<script src="comment/frontend/view/default/javascript/jquery.min.js">
</script>
<script src="comment/frontend/view/default/javascript/jquery-ui/jquery-
ui.min.js"></script>
<script src="comment/3rdparty/read_more/read_more.js"></script>
<script src="comment/3rdparty/filer/filer.js"></script>
<script src="comment/3rdparty/timeago/timeago.js"></script>
<script src="comment/frontend/view/default/javascript/common.js"></script>
<script src="comment/3rdparty/colorbox/jquery.colorbox-min.js"></script>
<script src="comment/3rdparty/highlight/highlight.pack.js"></script>
These last two are using $
<script src="js/core.min.js"></script>
<script src="js/script.js"></script>
  • what error are you getting in console .. you have to use `jquery.noConflict()` though – Niladri Sep 23 '17 at 10:40
  • Uncaught TypeError: $(...).filer is not a function at HTMLDocument. (clients1.php:638) at i (jquery.min.js:3) at Object.fireWith [as resolveWith] (jquery.min.js:3) at Function.ready (jquery.min.js:3) at HTMLDocument.K (jquery.min.js:3) – Martin Ďurický Sep 23 '17 at 10:42
  • I tried to use this – Martin Ďurický Sep 23 '17 at 10:44
  • is that coming from filer.js? can you share the required jquery versions for all your plugins in the question ? – Niladri Sep 23 '17 at 10:49
  • you can check this answer https://stackoverflow.com/questions/18569634/how-can-i-use-plugins-for-different-versions-of-jquery-on-the-same-page this describes the same scenario with steps – Niladri Sep 23 '17 at 10:50
  • If i add $old = $.noConflict( true ); after all – Martin Ďurický Sep 23 '17 at 11:07
  • in script.js you have to replace all `$` with `$old` if you have used `.noconflict` before that. what is the content of script.js and and core.min.js? – Niladri Sep 23 '17 at 12:14
  • Its working.Script.js are Global variables, core.min.js there are all plugins. Now i have this in my console. Its coming from core.min.js. JQMIGRATE: 'hover' pseudo-event is deprecated, use 'mouseenter mouseleave' JQMIGRATE: jQuery.fn.andSelf() replaced by jQuery.fn.addBack() JQMIGRATE: jQuery.parseJSON requires a valid JSON string – Martin Ďurický Sep 23 '17 at 12:24

0 Answers0