qTip jQuery version conflicts - javascript

Is it standard practice to hold an entire project at a certain release of jQuery until I can fix one measly bug?
details:
I'm using an older version of qTip because that is what works with jQuery 1.4.2 (the current release when I started the project). It's important to note that the release candidate of qTip does not work with the currently stable jQuery.
A bug showed up in my qTip functionality where the tool-tips starting animating themselves in from off-screen whereas they should pop-up on the element on mouse-over.
Needless to say, I thought I had broke something but eventually noticed that jQuery had moved up a notch so I moved back to jQuery 1.4.2 and viola, tool-tips work as expected.
Now I don't know what to do; I want to keep the project at the current and stable jQuery library but I'm not sure how to debug for something like this.
Also, I don't feel I should be submitting bugs to an old version of an app, either, but maybe I am wrong.
Thanks in advance.

On qTip library replace the line
if(typeof $(this).data('qtip') == 'object')
with
if($(this).data('qtip') !== null && typeof $(this).data('qtip') == 'object')
Good Luck!

Related

Workaround for file input label click (Firefox) - jQuery 1.9

First of all this is very similiar to:
Workaround for file input label click (Firefox)
but the provided solution is not working in jQuery 1.9+
The $.browser variable dosn't exist anymore because now we have to do feature detection.
I would very much like to detect the feature that I need but there seems to be no such support in jQuery.
Browser detection is gone, feature detection seems not able to detect what I need, is there a good solution out there?
A Modernizr solution would be appreciated aswell and also plain-vanilla-js solution is accepted
Thanks for your help.
if ( window.mozIndexedDB !== undefined ) {
//do firefox things
}
This will only return true in Firefox, afaik.
Example test:
if ( window.mozIndexedDB !== undefined ) {
alert('You are using Firefox');
}
You can try looking at window.navigator.userAgent but I don't recommend it, a bunch of other browsers identify as Mozilla, see this question for some examples: Why Does “navigator.userAgent” in javaScript returns the String “Mozilla” when tried in a google chrome borwser?
Not the best practice, but why don't you try the jQuery Migrate plugin? It brings back $.browser, aswell some other removed features.

Detecting whether a browser supports auto-expanding select dropdowns?

In IE 6/7/8 a <select> element, if given a defined width, does not automatically expand once opened. With browser sniffing (jQuery example was to use $.browser.msie and $.browser.version) I could detect the current browser to a degree of certainty and, for the relevant browsers add in a custom handler for selects.
In jQuery 1.9 the $.browser object has been removed. I am still using an older version in production, and am able to browser sniff and show auto-expanding select menus accordingly; However, this isn't a long term solution if we're going to keep up with the later releases of jQuery.
I've had a look through the properties of select via for(var i in document.createElement('select')) { ... } but can't see anything obvious relating to whether or not the menu will automatically expand.
Is there such a thing? Ideally, I'm looking for a vanilla solution that doesn't require browser sniffing. An if(!property in document.createElement('select')) { ... } would be fantastic.
[Edit / Addition] I know about jQuery migrate and understand it will probably tide us over. I'm not overly keen to load in more things for one (at the moment) tiny inconvenience.
From the jQuery API of jQuery.browser:
We recommend against using this property; please try to use feature
detection instead (see jQuery.support). jQuery.browser may be moved to
a plugin in a future release of jQuery.
I investigated and found the jQuery Migrate Plugin which has the $.browser feature, the code is available at github.

JQueryUI Autocomplete collides with legacy code

My issue is. I have jQueryUI in version 1.8.5 and lot and a lot of legacy source code in a project. In legacy code it happens that there is 3ple times registred plugin autocomplete for jquery. However jQueryUI is registring the very same plugin. So when I type into my javascript:
$('#some_id').autocomplete();
It's not actually a jQueryUI.
Any chance to explicit choose UI?
I tried such approach:
jQuery.fn.myautocomplete = jQuery.ui.autocomplete
And then to use in my code:
$('#some_id').myautocomplete();
But this does not work. (Well it was a blind shoot so I did not expect to much.)
Any suggestion how to workaround the problem.
P.S.
Legacy code is blessed by the Pope and cannot be removed for next year or so.
You can:
download jquery.ui without autocomplete
change jquery.ui source
change old plugin source

Internet Explorer 7+8 jQuery Error with infiniteCarousel

Hai guise! I am having a spot of trouble with some jQuery I am using, this was previously working but I have made many developments since then and tried to track back to find out what the issue was, but I am unsuccessful - hence, my presence on here. Anyway, I am getting some JS errors in both IE7 and IE8 with the catch my frame jQuery infiniteCarousel plugin, I am literally pulling my hair out over this as when you remove any reference to this everything works beautifully.
Here is a link to the page.
If anyone can shed any light on the matter you would be a life saver!
The problem is that the jQuery infinite carousel plugin is poorly written and the minifaction process requires well formed JavaScript. If you take his code and run it through JSLint you'll see it needs dozens of fixes before it's likely to minimize properly. This is something the author of the plugin needs to rectify.
Although it isn't throwing any errors, it seems that the plugin is loosing track of the elements. A possible solution would be to hook into the start and complete events and stop all the button events until it has completed the animation.
Alternatively, use this plugin instead: http://sorgalla.com/jcarousel/

Why do jQuery selectors sometimes not work in Internet Explorer

I have a very strange problem. Under some elusive circumstances I fail to apply any jQuery selector on my pages under IE. It's OK under Firefox though. The jQuery function simply returns empty array.
Any suggestions?
Page is too complex to post it here. Practically any selector, except "#id" selectors, returns a zero element array. The jQuery version is 1.2.3
What version(s) of IE is it failing under? Is it failing for a specific complex selector? I think we need an example.
Edit: Does the problem go away if you upgrade to 1.2.6? 1.2.6 is primarily a bug-fix release according to this page.
Failing that, the best way to find the problem is to create a minimum page that can reproduce the bug. Without that, it's just about impossible to troubleshoot.
Try upgrading to jQuery 1.2.6, you should be on the latest release of jQuery if you are having problems first ensure you are on the latest and greatest.

Categories

Resources