/    Sign up×
Community /Pin to ProfileBookmark

Javascript Version Question

I want to specify the use of JavaScript 1.5 on my site without specifying the language version as <script language=”javascript1.5″>

My question is, what if/then element is a good attribute to use?

Namely:

if (document.getElementById) {
window.location = “somepage.html”;
}

did document.getElementById start with javascript 1.5 or was it 1.4?

Either way, I need something that started with 1.5

Anyone?

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@robindeanauthorMay 22.2007 — I managed to google this ...

if (Number.prototype.toFixed) do something;

Are there any more / any SHORTER 1.5 specific calls?
Copy linkTweet thisAlerts:
@robindeanauthorMay 23.2007 — Thanks Jeff. I couldn't find anything smaller, though, so I suppose I'll have to stick with what I have ?
Copy linkTweet thisAlerts:
@mrhooMay 23.2007 — if((1).toFixed){

// returns true if [B]1[/B] (an instance of Number) has the method [B]toFixed[/B]
Copy linkTweet thisAlerts:
@robindeanauthorMay 23.2007 — Big thanks ?
×

Success!

Help @robindean 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.19,
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,
)...