As for interacting with the DOM, different browsers will offer methods -and results- that are different between them to some or other extent.But how about JavaScript itself? Do all browsers (or platforms e.g. Adobe Reader) implement the same syntax and behavior?Aspects that particularly worry me are function/object handling and arithmetical operations.
Is the JavaScript syntax the same for all browsers?
web development;javascript
All browsers that are used today support a common javascriptJavascript is defined by the ECMA-262 standard, either version 3, or version 5. Both versions have the same syntax -- the new things in version 5 are all backwards compatible. All browsers support the version 3 syntax and objects. Internet Explorer has some brokenness, but supports all the basic syntax and semantics. Firefox has some extensions to the language, but those are disabled on web pages, and are only available for extensions.The last piece of missing syntax that was seen in a browser was in IE 4.0, which did not have try/catch/finally. That arrived in IE 5.0. The biggest syntax danger you can still run into today is that IE improperly processes trailing commas in array and object literals. Make sure you don't have any of those, and you can write cross-browser javascript just fine.