OZONE Asylum
Forums
DHTML/Javascript
20 Liners - January 08 - Dynamics
This page's ID:
29836
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
[quote] [b]poi said:[/b] MaGnA: Nice optimizations.I see you're using the JS 1.6+* Array.prototype.every method which is a Mozilla invention.[/quote]And on ES4 track, and supported by WebKit. [quote]Array.prototype.every = Array.prototype.every||function( callback, that ){ for( var i=0; i<this.length && callback.call( that||this, this[i] ); i++ ); return i==this.length;} This at least makes the script work in Opera 9.5, but thows in IE7. Will try to figure why.[/quote]Strange. It works well enough in IE7 when trying to analyse it like this:[code]var a=[]; alert(1+' '+Array.prototype.every); Array.prototype.every = function( callback, that ){ alert('every!\n'+this.length); for( var i=0; i<this.length && callback.call( that||this, this[i] ); i++ ); return i==this.length; } alert(2+' '+Array.prototype.every); [0,1,2,3,4,5].every(function(x,y){alert([x,y]);a.push(x+':'+y);return true;}); a.join('\r');[/code] [quote]*: wouldn't be great if there was a standard body for JavaScript instead of browser vendords adding whatever they want with no discussion.[/quote]JavaScript being Mozilla's version of ECMAScript, I'd say Mozilla is the standardising organisation. They're driving the ES4 process, too, so expect JavaScript1.6-1.9 additions to be included in the ES4 standard library.[quote]I'm really looking forward to ES4[/quote]You're not alone. -- var Liorean = { abode: "[sigrotate][url]http://liorean.web-graphics.com/[/url]|[url]http://codingforums.com/[/url]|[url]http://web-graphics.com/[/url][/sigrotate]", profile: "[url]http://codingforums.com/member.php?u=5798[/url]"};
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »