/    Sign up×
Community /Pin to ProfileBookmark

browser quirks

[code]
Function.prototype.extends = function(class) {
// code
}
[/code]

Works in Firefox, Chrome, and Opera. Does not work in WebKit based browsers (ie WebKit / Safari).

Any Suggestions?

Page in question is: [URL=”http://jacksonkr.com/test.html”]http://jacksonkr.com/test.html[/URL]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@mrhooMar 23.2010 — Use Function.prototype.[B]extend[/B] instead.

webkit has a special place in its heart for [B]extends[/B].
Copy linkTweet thisAlerts:
@ofeetauthorMar 23.2010 — Use Function.prototype.[B]extend[/B] instead.

webkit has a special place in its heart for [B]extends[/B].[/QUOTE]


Hah

Not only that, but it looks like it's got a little thing for "class" as well. I suppose I should be more astonished that the other browsers aren't reserving those keywords.

Thanks mrhoo, hooever you are.
Copy linkTweet thisAlerts:
@mrhooMar 23.2010 — The rules are fuzzy between browsers-

generally these words are keywords, but each browser is free to

ignore their use (like extends) or assign its own.

abstract, boolean, break, byte, case, catch, char, class, const, continue, debugger, default, delete, do, double, else, enum, export, extends, false, final, finally, float, for, function, goto, if, implements, import, in , instanceof , int, interface, long, native, new, null, package, private, protected, public, return, short, static, super, switch, synchronized, this, throw, throws, transient, true, try, typeof, var, void, volatile, while, with
×

Success!

Help @ofeet spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...