jquery 1.7 "on" method IE8 crashes mshtml.dll - javascript

As mentioned I'm using latest version of jQuery.
I simply call
$('table').on('click', 'tr', function() {
alert('click');
});
It runs well on every browser except IE8 (not tested on IE7).
Note I'm running Windows on Parallels Desktop on my iMac.
The crash has something to do with mshtml.dll as reported by IE8 Crash dialog box.
Any advice?
Check the jsFiddle here: http://jsfiddle.net/powtac/kuht6/4/

is working fine here something else could be wrong
http://jsfiddle.net/5Hhmg/

Related

Jquery on click doesn't work on Firefox Android

I'm using Jquery 3.1.1. My code works fine on desktop and Chrome Android, but doesn't work at Firefox Android.
$('.menu').on('click', function() {
$('.aside').addClass('slide-in');
});
Making 'click touchstart' doesn't help, even causes more problems as on Crhome it makes two "touches" instead of one

'onhashchange' not working in Chrome

I'm trying to detect hashchanged which works fine in every browser except chrome. For example, with this code:
if ("onhashchange" in window) {
alert("The browser supports the hashchange event!");
}
The statement is never executed in Chrome but works in Firefox. I've seen a jQuery hashchange plugin on GitHub but didn't have any luck with that either.
Any ideas?

bind is not working in safari 5.1.1

I'm using safari 5.1.1 in my system and my application is also running in safari 5.1.1. In my application i'm using window resize event with bind method. Its working fine all other browsers like ie, chrome,firefox but it doesn't work in safari 5.1.1 and less. whenever its run it will through an exception as '"undefined" is not a function({....}.bind(this);...'.
I have searched more about this issue but i din't found any solutions to recover this issue.
$(window).resize(function () {
alert("resized");
...My code goes 'this' here....
}.bind(this));
Is there any way to resolve this issue?
Thanks,
KarthiK
The error most likely comes from .bind(this). As you see in the MDN docs about Function.prototype.bind, safari supports bind in versions >= 5.1.4.
You can use jQuery.proxy instead.
var resizeHandler = function() { alert('resized'); };
$(window).resize($.proxy(resizeHandler, this));
Did not test the example but it should look like this.

Click events and Google Chrome and Windows 8

I am trying to use the following JQuery code:
$("#thing").on("click", function() {
....})
And it doesn't work on Google Chrome in Windows 8, but it works in Firefox on Windows 8 and basically every other OS. Any ideas?
It works, check this: http://jsbin.com/ofuvuh/1 Probably there is some error in the code that ff ignore or maybe it's your browsers fault. Please check the chrome and ie console, probably it can helps
Try:
$("#thing").click(function ()
{
// your code here
});
Which is the same as .on('click', handler). See .click documentation.
Your code snippet looks completely fine. I assume you are using a fairly up to date version of jQuery, so most probably it is nothing to do with jQuery or the browser. I suspect there might be something wrong with the code surrounding your snippet.
As a possible solution:
In Chrome you can bring up the Console, which will tell you if there is any errors in your JavaScript (developers.google.com/chrome-developer-tools/docs/…). Open it up, refresh your page (you might see the error in the Console straight away). Or click that '#thing' and watch out for any possible errors coming up in the Console.

IE9 and modernizr 2.6.1, dropdownlist does not open

Dropdownlist on my MVC4 application using modernizr 2.6.1 running on IE9 shows unexpected behavior. It works fine on FF and Chrome. It also works when modernizr 2.6.1 is unreferenced.
The problem is that when a page loads up some of dropdownlists open up by clicking on them, they also accept keyboard inputs but some of them don't accept inputs(mouse and keyboard) at all. But after few random clicks, some of them start working when they get and loss focus few times.
How do i troubleshoot this problem?
Edit
It is confirmed that something is wrong with modernizr, i removed all the scripts except modernizr and the problem is there and the problem is gone when just modernizr is removed.
I have a simalar problem with IE, Modernizr och jQuery UI Slider element. Works in Firefox, but not in IE. If I remove Modernizr, it works in IE as well.
Modernizr does not work with IE, simple !!!

Categories