V
VK
Taking into account many new features in JavaScript1.6 and
JavaScript1.7 which are syntactically incompatible with Javascript
versions run on other browsers: would it be reasonable to propose as
"new feature request" at bugzilla.mozilla.org the conditional
compilation mechanics. Obviously this mechanics has to be then fully
compatible with the existing one for IE:
http://msdn2.microsoft.com/en-us/library/7kx09ct1(VS.71).aspx
and further links.
JScript sample:
<script>
/*@cc_on @*/
/*@if (@_jscript_version < 5.5)
window.alert('JScript below 5.5');
@elif (@_jscript_version >= 5.5)
window.alert('JScript 5.5 or higher');
@else @*/
window.alert('Not a JScript parser');
/*@end @*/
</script>
For the seamless accommodation it is needed to add to the list of
conditional compilation variables extra two:
@_javascript
Always returns true for Gecko platforms.
Respectively @_jscript always returns false for Gecko platforms.
@_javascript_version with possible values 1.5, 1.6, 1.7, (1.8, ..)
IMO it is the only way to have any use out of extra features in a
cross-browser way: leaving out different hacks with dynamic "<script>"
write and separate .js files for different browsers.
Any opinions on that?
JavaScript1.7 which are syntactically incompatible with Javascript
versions run on other browsers: would it be reasonable to propose as
"new feature request" at bugzilla.mozilla.org the conditional
compilation mechanics. Obviously this mechanics has to be then fully
compatible with the existing one for IE:
http://msdn2.microsoft.com/en-us/library/7kx09ct1(VS.71).aspx
and further links.
JScript sample:
<script>
/*@cc_on @*/
/*@if (@_jscript_version < 5.5)
window.alert('JScript below 5.5');
@elif (@_jscript_version >= 5.5)
window.alert('JScript 5.5 or higher');
@else @*/
window.alert('Not a JScript parser');
/*@end @*/
</script>
For the seamless accommodation it is needed to add to the list of
conditional compilation variables extra two:
@_javascript
Always returns true for Gecko platforms.
Respectively @_jscript always returns false for Gecko platforms.
@_javascript_version with possible values 1.5, 1.6, 1.7, (1.8, ..)
IMO it is the only way to have any use out of extra features in a
cross-browser way: leaving out different hacks with dynamic "<script>"
write and separate .js files for different browsers.
Any opinions on that?