Is there a concrete date when event.getDefaultPrevented() will be removed? - javascript

I have a large project with more than 1 million LOC, and I'm trying to prioritize the conversion from getDefaultPrevented to defaultPrevented. I noticed that it has been deprecated several years and am curious how soon it will finally be removed

I'm not sure how to answer that. Maybe a good way to get a realistic answer could be to ask people in the bug 691151, the bug that was filed about the removal.
It looks like all the code depending on getDefaultPrevented was removed from mozilla-central and the site compatibility documentation was updated recently about that as well.
I would not bet on the removal taking much longer.

Related

Any alternatives to createScriptProcessor to get live raw audio data?

Firefox seems to have a buggy implementation of this audio node (see this question) so, as I suspect bugs in deprecated features are unlikely to get fixed, I'm looking for another solution.
Mozilla's website says createScriptProcessor is slated to be replaced by audio workers "soon" but work on that doesn't even seem to have begun yet.
All the libs I've looked at seem to use createScriptProcessor. You can get at time domain data from within Analyzer Nodes so that's my next lead but that also seems pretty kludged so I thought I'd ask here in case I've overlooked a better way. Thanks!

When did all browsers start supporting the String.replace(regexp, replacement_function)?

According to the 6th Edition of JavaScript: The Definitive Guide (Flanagan, 2011):
ECMAScript v3 specifies that the replacement argument to replace() may be a function instead of a string.
I'm looking at some code written in 2005, where a complicated workaround has been used to replace parts of a string. The comments for the code clearly indicate that it originally used the functional replace() method but that the workaround was necessary for cross-browser compatibility.
ECMAScript v3 came out in 1999 and, as far as I can tell (from this discussion post and this blog post), ECMAScript v3 was supported across the main browsers since late 2001. Could the author have been wrong, or can someone shed light on why such a workaround might have been necessary in 2005?
...
UPDATE The actual comment by the author of the code says:
lambda functions in RegExps are currently a problem with too many browsers.
changed code to work around.
The author code works for or runs this business, though the code itself may well be a personal project.
This answer is based on the comments to the question above (with special thanks to kangax, whose answer I will likely accept if he chooses to leave one!)
Whilst it's possible that I could have been reading "too many browsers" literally, it's also possible that String.replace() with a function as the argument was a problem in Safari 2.x (using JavaScriptCore) and in IEMac 5.x in the year 2005. Evidence of these problems in that time exists here, and with those particular versions of the aformentioned browsers here.
In fact the workaround mentioned by Gavin Kistner on the first of those pages is one whose performance may be better in some browsers than the functional replace method, as discussed here.
Nevertheless, performance aside, it seems (as I suspected) that a functional replace is acceptable in all browsers today.
Many thanks to all commenters on this question.

Where can I find up-to-date browser compatibility guides?

Let me start by saying I really appreciate the work done at QuirksMode.org but in recent experience the content seems a bit dated.
Some pages haven't been updated from anywhere between 6months and a year.
Compatibility tables still only show chrome at version 5.0 (W3C DOM Compatibility) or 1.0 (Event compatibility tables)
In cases where content seems a bit dated I generally refer to Sitepoint's References, but their HTML and Javascript Reference pages are also a bit our of date.
What compatibility reference guides do you all use?
update
I'm aware of sites like CanIUse, which are invaluable reference new feature support like new JS API libraries and CSS3 support. However I'm more interested in things like supported attributes (bad example I admit) and browser events. The more vanilla stuff.
And please, noone mention w3schools (see w3fools why you should never use this site)
http://caniuse.com is quite good and (provided you use the correct keywords) has good search functionality as well.
In addition to the above you might be interested in the ES5 compatibility tables that Kangax maintains at http://kangax.github.com/es5-compat-table/
update
In the meantime there is also the ES6 compat table. Quite red for now (9/2014) admittedly, but getting more and more useful.
I trust Quirksmode, have you any idea how many tests PPK runs? It's not that it's outdated (yet!) it's that CSS support (and Browser uptake) has reached a new level, trust me you will appreciate the experience if you have to support an older browser.
Not every FF or Opera user updates quickly anymore which is what could be relied on for a while! - so yes you're right to question the findings. personally I look for recent sites too but I don't "trust" them nearly as much as the older and even then I tend to test for myself.
There's no replacement for experience IMO often these guys can "guess" at what may be the problem based on their past experience even if the so called "bug" or unexpected display is new to them in that context.
I have a "bug" report detailed on PPK's site - yea it and me are old - but only last week I got asked about something (seemingly unrelated) which turned out to be the same thing and have the same solution, it's IE7 related so will be with us for a while yet. (I see caniuse thinks that's old eeek!) - I am completely in awe of these guys who have kept up these sites for so long, if you can reverse engineer the bugs you get to understand the browsers.. that will never fail you as long as the browsers are on the go - their render engines don't usually change all that much between versions!
but then again this is a new era of Browser wars so who knows what will happen :)
Have a look at this big javascript compatibility table
http://compatibility.shwups-cms.ch/de/home/
Its very big, but checks at the moment only for existenz of javascript properties.

Where do I get a list of javascript functions along with which browser it's supported in?

There are some JS functions that are IE specific. I am working on an application which has cross browser compatibility as a mandatory requirement. Before I use a JS function, I would like to know which browsers support it. Is there an online resource that can help me with this?
Look at quirksmode.org
You should consider buying his (PPK's) book (I am not on a commission), as it encourages you to use defensive coding with your javascript, so that you have code that detects objects, not browsers. This way of working changes the way you write javascript (even before you get to frameworks), so that the code is easier to maintain and develop.
Some of the other answers point to W3Schools, which has always been where I go to try stuff out when I'm working on front end stuff, it is very useful.
The other thing that I tend to do when I'm on a Javascript mission is to use Aptana for developing. This has some degree of intellisense that also indicates which mainstream browsers support the available functions. I think they still have a free version which will do the job in most cases.
Someone also mentioned that this question may be a duplicate, but sometimes the words used to ask the question make such a difference to how it is later found, even with the powerful searches we have available.
Hope this helps.
The spec is your friend. MDC is also quite useful.
http://www.w3schools.com/jsref
I would check http://www.w3schools.com/JS/default.asp

What is the best online javascript/css/html/xhtml/dom reference? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm a front-end developer and I was looking for opinions about the best all-round online documentation for javascript/css/html/xhtml/dom/browser quirks and support. I've tried Sitepoint, Quirksmode, W3Schools but all of these seem to be lacking in certain aspects and have been using them in combination.
I like Mozilla's references:
http://developer.mozilla.org/en/JavaScript
http://developer.mozilla.org/en/DOM
These are not at all the one stop site you want, but they help me.
I like gotapi.com (Update 2: Site is apparently offline -- Use another resource such as MDN)
Update: the original answer was from 2008 -- today I would say to check out Mozilla Developer Network (as many others have also said).
You've actually hit the nail on the head in your description. There is no single website that'll provide you with the detail you seek in every one of those facets.
I find these three are incredibly useful when starting on a blank page: Mozilla DOM Reference (for general js syntax, etc), w3schools x/html reference (look up uncommon attributes!) and quirksmode (cross-browser js/style details). These are quite highly ranked so look for their urls if you're searching for something specific.
As for specific browser quirks, your best bet is to handle these as they come up and develop skills for googling for answers efficiently. Lots of browser quirks have many variables that go into what you actually end up seeing and how developed a 'solution' is for a specific quirk depends on how much time someone has spent investigating it. Read a bunch of search results and see if the problems are all similar or completely separate. Then, refine your search!
Go straight to W3C docs. They're a bit cryptic at times, but they're solid documentation.
For quirks, obviously sites like Quirksmode are good. But only once you've read actual W3C documentation.
Sitepoint has a very comprehensive guide to CSS
The same reference which is included in the Aptana IDE is online... just found this... it's really good:
CSS
http://www.aptana.com/reference/html/api/CSS.index.html
HTML
http://www.aptana.com/reference/html/api/HTML.index.html
HTML DOM O
http://www.aptana.com/reference/html/api/HTMLDOM0.index-frame.html
HTML DOM 1 & 2
http://www.aptana.com/reference/html/api/HTMLDOM2.index-frame.html
JavaScript Keywords
http://www.aptana.com/reference/html/api/JSKeywords.index.html
JavaScript Core
http://www.aptana.com/reference/html/api/JSCore.index-frame.html
I like w3schools for html or simple questions.
For Javascript, I find Mozilla Developer Center to be pretty useful: Core Javascript 1.5 Reference
zvon.org
http://reference.sitepoint.com/
blooberry.com is a great HTML/CSS reference site.
devguru.com
I rely on http://quirksmode.org/resources.html for information on HTML/CSS/JavaScript. This resource does a great job addressing cross-browser compatibility issues in a helpful table format.
This may be useful for some javascript functions http://kangax.github.com/es5-compat-table/
I tend to go to http://msdn.microsoft.com/ first.
There is a very good german reference (and french I think) at selfhtml.org.
I recommend going through these JavaScript Video Lectures (15 of them).
GotAPI is a fantastic resource http://www.gotapi.com
http://www.selfhtml.org/ is in German (originally) and French (translated). English translation has been unfortunately suspended: http://en.selfhtml.org/
I'd recommended w3schools.com. It's a pretty good and comprehensive library, I find.
I always start with www.zvon.org, especially the references section. Provides a good overview and links directly to the corresponding standards.
javascriptkit.com/jsref/ (convenient JavaScript reference with examples)
javascriptkit.com/domref/ (DOM reference with examples)

Categories

Resources