views:

156

answers:

3

How can I see what verison of javascript does my browser use ?

+5  A: 

There's no "central" version control of javascript, unfortunately. Each version of each browser uses its own version of javascript, and so the most meaningful way to talk about this is to say "javascript as interpreted by Firefox 3.5" or whatever your help->about menu says.

Paul McMillan
A: 

Javascript doesn't contain anything that can test for which version is supported but surprisingly HTML doesCheckOU

GustlyWind
yeah, that doesn't quite work so well.
geowa4
+2  A: 

JavaScript is not like other languages in that there are a given set of features for any particular version. Every browser has implemented its own set of features its own way. As time moves along, more and more browsers are starting to standardize on features. However, browsers will never be equal. For example, Safari has SQLite support and Firefox now has Web Workers. They will always be battling and throwing in new features.

I assume the reason you ask is because you want to know what features you are free to use for the browsers you intend to support. For this goal, I recommend using object detection. Basically, instead of determining which browser you are running on (and thus knowing which features are available), you check if a given feature is available. If it is, great! If not, do something else. This creates much cleaner code, and makes it easier to maintain.

geowa4