Firefox doesn't support onfocusout - javascript

I am using onfocusout as an html attribute and some javascript code inside it. Nevertheless, the code works fine in Chrome and browsers powered by webkit engines but it doesn't work in Firefox, I haven't tested other browsers yet.
Is there any alternative for 'onfocusout' attribute which is supported at least by firefox and chrome?

Can you use onblur?

Not sure what elements you are targeting but blur may work for you.
If that doesn't work for you then you may want to include a framework like jQuery which will help you with such cross browser issues.
http://api.jquery.com/focusout/

I know this question is from 2011, just want to let everyone know that FireFox support for this attribute is now available since March 6th, 2017: https://caniuse.com/#search=focusout

Related

How to check if browser supports pseudo-elements in javascript?

I'm developing a website that should run in ancient browsers (IE 7/8/9, Safari 5.1.7). Our target customer is the old people.
I'm no expert in javascript and I searched for solution. My title question is very straight-forward.
I used input radio and others that has custom design using before and after.
If it's checked. I just toggle in after and before display property in css.
The problem is when the user is using ancient browser, the input radio will never appear. My idea is toggle display in input radio if the browser doesn't support pseudo-elements.
For CSS feature detection there really is no need to reinvent the wheel, tools like Modernizr do this perfectly and have a very small footprint, since you can select only the feature detects that you need.
Seeing as you want to support IE <8, I would strongly advise you to use it, since you're probably going to run into a lot of situations where CSS/JS features are unavailable.
Detect if they have a sufficient browser: http://caniuse.com/#feat=css-gencontent
Basically, IE8 (maybe 9 depending on what you need) and older don't work, everything else does.
You may find the library Modernizr useful in this instance. It allows you to test for browser features.
Optionally if you want to shim it so you know that the browser will support it you can use Selectivizr

Why wont IE fire on paste event?

I need help figuring out why Internet Explorer won't fire my 'paste' event.
I'm using IE 11. Here is my code:
$(document).on('paste', '.pasteTarget', handlePaste);
When trying this in IE, the function never gets called. It works in chrome.
Different browsers treat onpaste differently, or not at all. For IE 11, the latter seems to be the case.
From MDN:
Non-Standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
Source
Edit: As pointed out in the comments, IE 11 does indeed support onpaste to some extent. However, as this is a non-standard feature, you should be careful about using it in production.
You could use beforepaste event instead and access clipboardData from window, not from the event.
But, indeed as pointed out already, Clipboard API doesn't seem to be supported in IE: https://developer.microsoft.com/en-us/microsoft-edge/platform/status/clipboardapi/

Need paste event for IE7 (Jquery paste event do not work in IE7)

I know it's quite backward to ask for IE7 support and latest browsers are reliable. But I still need it to fire paste (mouse paste and ctrl+v paste) reliably in an IE7 based tool. Any help is appreciated.
May be you use incorrect version of JQuery:
JQuery 2.x has the same API as jQuery 1.x, but does not support Internet Explorer 6, 7, or 8.
Try to use 1.x version.

Floating Labels - IE Compatibility. Anyone know how to add compatibility for IE8 & IE9?

I'm using this plugin for my website:
http://headdetect.github.io/bootstrap-floating-labels/
The bootstrap floating labels plugin.
It's essentially placeholders.
However, it doesn't currently support IE8 / IE9. Does anyone have any suggestions on how to add support? I'm using Modernizr.js on my website, which I thought added support for that but I guess not.
Thanks.
The issue is IE9 and below not supporting the placeholder attribute. What you need is a polyfill. See this related post: The best placeholder polyfil script for ie7, ie8 and ie9

"text-decoration: blink" & IE

Why text-decoration: blink wont work in IE ?
What is the work around ?
Is there a non JS work around?
Do Microsoft have a plan to support this style?
IE doesn't support it. See Wikipedia: http://en.wikipedia.org/wiki/Blink_element
Also, don't. There's a reason it isn't implemented, and finding a workaround will do nothing but annoy your users.
Not sure whether Microsoft is planning to put that in but for the moment you are out of luck as far as IE (obviously) is concerned. No support for it.

Categories

Resources