Dojo widget is not working properly with jQuery - javascript

I am using jQuery and Dojo widget on same JSP page but getting this issue,
Dojo part is working fine until I click on jquery based dropdown, as soon as I click jQuery-Dropdown, dojo based dropdown stops working.
I have searched a lot and tried following to resolve this issue but no use
Has anybody used Dojo and JQuery in the same project?
If I use
$.noConflict(true);
jquery dropdown stops working after one click, which means on first click it opens but then is not closed and not do anything else.
all the help would highly be appreciated.
Note: This is the very first time I am using Dojo and jquery.
EDIT: I used closure as well something like
(function($) {
var jQuery = $.noconflict(true);
var $ = jQuery;
})(jQuery);
but it also didnt help.
Please tell me how to make Dojo dropdown keep working even after Jquery-dropdown clicked.

If it helps there is another question regarding how to use jquery with dojo in the same project, it gives an example of the dojoConfig and talks about how to import jquery using AMD.
jQuery / Dojo - How do I use jQuery with Dojo toolkit

Related

How to make a jquery script compatible with jquery 2.x.x

I'd like to use this multi-level push menu in my webapplication. But the problem with this plugin is that it needs an older version of jQuery. It will crash in combination with v2.x.x of jQuery.
The owner has done this on purpose, so that older browser versions are covered with the plugin as well.
So I'd like to convert/migrate this script to make it compatible with the latest version of jQuery, the only problem is, is that jQuery isn't my 'thing' (yet). I'm not sure where to start, what to remove of what to add in the script.
My question basically is, can someone point me into the right direction to get this script working with the latest version of jQuery?
I'd really really appreciate any help!
EDIT:
UPDATED ANSWER:
Use Version2 from the Multilevel Push Menu download page! ::link:: ...
I downloaded that version, and changed from jquery-1.10.2 to jquery-2.0.3 ... and it's working perfectly! Here's a jsfiddle: jsfiddle.net/vLrp51g3
PREVIOUSLY ANSWERED
As suggested by A. Wolf, you can use migrate jquery js file to handle the older jquery version. Since the remaining plugins/scripts of your webpage might require latest jquery, you could use the getScript() function to load the migrate jquery for only the pushmenu plugin! Therefore, you should probably use the code provided below for your requirement...
$(document).ready(function(){
$.getScript( "http://code.jquery.com/jquery-migrate-1.2.1.min.js", function() {
$.getScript('js/jquery.multilevelpushmenu.min.js', function() {
$('#menu').multilevelpushmenu();
});
});
});

jQuery undefined function in wordpress plugin which creates a fullCalendar

I am creating a plugin which uses the jQuery fullCalender.
The code appears to all be working fine however when the page fully loads and my shortcode populates its appropriate html and javascript I get the following error:
So from this I can gather that jQuery resolves ok - but somehow the calendar does not? Can somebody please help me! It may be because I am using OptimizePress which might be including its own copy of jQuery - and my plugin is also including a copy of jQuery and the calendar. But I dont know how to make sure i reference my own jQuery or make this work.
Thanks!
The answer was to use wp_register_script and wp_enqueue_script to add the script to my generated document

Jquery UI autocomplete in APEX

In APEX pages that have a text field with autocomplete, $.fn.autocomplete is overridden by a totally different function that integrates APEX functionality.
jQuery UI is loaded, but overridden.
How can I use the jQuery UI version?
To avoid conflict between different jqueries having different versions use noConflict() method which returns a reference to jQuery, that you can save in a variable.Please check documentation https://api.jquery.com/jquery.noconflict/
Hope this will help you.

click() event not working. scripts conflicting with each other

I am using jquery-1.10.2 and bootstrap for my project.To develop an autocomplete module I included jquery-ui-1.8.10.custom.min.js and jquery-1.4.4.min.js.
After that, forms which are being submitted by using jquery, are not working.The click() event is not working for any of the forms.
Are these scripts conflicting with each other?
Please tell me how to recover from this. I am baffled.
You should only be using one version of jQuery not two.
For example, you can do this:
jQuery v1.10.2
Bootstrap v3.0.3 (works with jQuery v1.10.2)
jQuery UI v1.10.3 (works with jQuery v1.10.2)

How to get FormCheck jQuery script set up and working

I am trying to use FormCheck for MooTools to validate a basic contact form I am planning to build. The problem is I can't seem to set up the script to work at all =(
If anyone knows about FormCheck or MooTools and can add any pointers they would all be greatly recieved.
My website is here: http://ryanis.me/
You are using jquery AND mootools on the same page? Why would you do that, it's a bad practice and bad form to stuff your users for two frameworks for what is a small page without anything complex. that aside, are you using the noconflict mode in either framework (note that this is only available since mootools 1.2.3 and requires some changes in the source code of the plugins, probably better off namespacing jquery)
first of all, you have a mootools domready function then you do inline js on the body tag onLoad...
then at the bottom of the source, you try the mootools domready again...
then you embed an accordion script (something that mootools can have built in as part of mootools-more). not sure what you use jquery for but you really need to structure your page better and pick a single framework.
the error you are getting in the formcheck js implies that either this.form is undefined (at time of evaluation $("contactform") was not available or that this.form.getElements() is not a valid method, which would imply that the mootools element prototype is not working. once again, are you using the noconflict mode?
it really needs refactoring and rethinking...
If you are using jQuery you may want to check out various jQuery plugins that will do form validation for you. The validation plugin works pretty well. If you want to use jQuery and MooTools together, you probably need to make sure that you are using jQuery in noConflict mode.

Categories