1

I want to implement XMPP chat functionality in my system using converse.js for client side chat interface. but when i use converse.js in my layout page, browser showing me error like

$(...).datetimepicker is not a function
$(...).dataTable is not a function. 

I have used bootstrap datetimepicker and datatables. It seems like jquery conflictions. I have tried to resolve conflictions by changing place of some jquery files. but i didn't get success. So how can i remove conflictions?

McGrady
  • 10,869
  • 13
  • 47
  • 69
Bharat
  • 93
  • 11

1 Answers1

0

EDIT: As of version 3.0.1 this shouldn't be an issue anymore. In previous builds the $.noConflict call wasn't being made. This is now fixed in 3.0.1. If you're using an older version, then the text below is still relevant.

Converse.js comes bundled with jQuery. It uses jQuery's noConflict method to relinquish control of the $ variable and therefore to avoid conflicts with other versions of jQuery, but apparently this doesn't always work reliably.

There are a few things you can try:

  • Load converse.js before all your other JS libraries.
  • Alternatively, drop your own jQuery and instead use the one included in converse.js. You can access it via converse.env.jQuery.
  • Or alternatively use the converse.js bundle that doesn't include jQuery: https://cdn.conversejs.org/dist/converse-no-jquery.min.js
JC Brand
  • 2,652
  • 18
  • 18