PDA

View Full Version : JavaScript compatibility, and support status


krycek
11-08-2002, 12:51 AM
Just wondering a few things about JavaScript.

If my script runs fine in IE6, how far back will it go? (IE 5, IE 4, etc.) Is there anywhere that there is a checklist of features used etc. that I can look at? In my current project I have to tell the client the minimum browser spec, and if they can get away without upgrading everything just yet, that would help.

Second, how do I check if the user has JavaScript enabled in their browser? I am building a system that is almost totally dynamic - the whole page is created in JS so if the user has disabled it or something, nothing will happen. I could put a default HTML message on the screen and then overwrite it... but what if they had time to read it while the page loads? I would only want them reading it if they had no support enabled.

Lastly, what platforms are my scripts going to run OK on? I am *guessing* anything with IE version X or above (see first question) but I especially need to know if my code will run OK on handheld/pocket PCs and PDAs etc. And, not just PocketWindows ones... what about Palms and Psions etc.

All information will be welcomed with exceedingly great joy :D

::] krycek [::

joh6nn
11-08-2002, 01:50 AM
following the reference links in my sig is a good way to start. the Guide is a link to JavaScript, the Definitive Guide, 4th Ed. One of the best references out there; details what will work where. also, MS Dev Library, a good way to find out wha's going to work in IE, and NS Dev Edge, the source for the nitty gritty details of javascript.

there are <noscript> tags for html, and their content only renders if javascript has been turned off.

sorry to say i don't know anything about support on portable devices.

beetle
11-08-2002, 02:07 AM
For compatbility, try the xBrowser link in my sig.

Ditto to joh6nn on the <noscript> tags.

Handhelds? Forget about it. It's enough of a chore just to get content to them correctly. I'm not saying 'NO', but I think just the chance of any of your javascript working (if ECMAscript is even supported by these devices at all, which I doubt) is slim to none.

Lynx is a text-only web-browser designed to work as far back as DOS on a 386. It gives you a decent idea of your page will look to a device that only cares about the textual content. Here's (http://www.delorie.com/web/lynxview.html) a nifty viewer, just plug in a URL and check it out :D

krycek
11-08-2002, 02:48 AM
Thanks guys! :)

I had totally forgotten about <noscript> tags - silly me! (Slaps head and says "DOH!" loudly ;))

The links you mentioned are ones I have already looked at (I have a thing about following people's sig links!) but good to know they are still the recommended ones :)

...are you sure about the handhelds, beetle? :confused: I thought that the latest PocketPCs with PocketXP and PocketIE were supposed to browse the Net just fine... I expect you are correct about the earlier ones though :)

I don't have access to handhelds for testing at the moment, and I don't want to go and buy one because I know I would never use it :D maybe later... when I have more money... lol!

::] krycek [::

Graeme Hackston
11-08-2002, 02:49 AM
An alternative to <noscript> is to style the page for javascript disabled browsers. Then serve enabled browsers CSS that change display, visibility etc. using JS.

whammy
11-08-2002, 03:09 AM
Or (this may not apply to handhelds and Pocket PC's etc., you probably need to figure some server-side stuff out for that specifically) but for normal web browsers, you can just document.write() a hidden field on your first page to see if javascript is enabled.

If that value is not present when you request the "hidden" field that was written by javascript when you get post information, then you know that javascript is not enabled on the client's browser.

I've just started working on the WML/XSL kind of stuff myself, so I doubt this will be useful in that regard...

beetle
11-08-2002, 03:20 AM
Dunno about the newest stuff. I'll try to research it a bit. If you find something out, let me know, likewise I'll let you know if I make any discoveries. In short, I'm not sure, let's just say I have a "believe it when I see it" mentality on this issue :D

However, for something pretty recent on the "web-to-handhelds" front, check out Sometimes They Listen (http://www.scottandrew.com/weblog/2002_10#a000438)

whammy
11-08-2002, 03:26 AM
With regards to javascript, that's the only time I believe anything works. ;)

If I see it working! :D

P.S. that's a pretty cool link you just posted.

Everyone here needs to develop to the standards that ARE in place (in ECMAScript), so that browser developers quit making proprietary garbage.

As for how far back you need to worry about... I personally have left NS 4.x in the dust.

If anyone is still using it, they must see errors most of the time they are surfing the internet, and very ugly pages since it doesn't have anything approaching CSS support.

In which case, I figure so what? My site must be another ugly site (only to them) which actually works in everyone elses browser. :D

boywonder
11-08-2002, 03:40 AM
ditto whammy...

I check for IE or Gecko browsers and flag them as 'good' for my fancy dynamic stuff. All others are flagged as weak browsers but they still get a generic version of the same thing. In any event they all get the content, but some 95-98% of my visitors get the 'good' stuff.

There's no point IMO opinion wasting 1 minute sweating over NS 4 users or anyone else (spoofing etc.) when at least they get the same content, just not as pretty.

whammy
11-08-2002, 03:48 AM
Right on... one of these days I'm gonna catch up on all the javascript stuff... but I have been purposely waiting for standards. Now that we finally have some, I'm learning them. ;)

In the meantime I've been too busy learning stuff that I actually may get paid for like getting a Microsoft certification or two (lol) and avoiding learning confusing workarounds for all kinds of proprietary stuff (while using what does work)..

I'm sure I won't have too much of a problem learning what results from this mess. ;) But the whole "code workarounds for this and that browser" nonsense is just not worth my time, it even annoyed me a couple of years ago when I had no idea what a server-side script was. And apparently for good reason. ;)

If it doesn't work, I just don't use it. :D

beetle
11-08-2002, 03:58 AM
Ditto, and....uh....ditto. I'm not too sure how many people here rely on web-design/development for their livelihood, but I'm sure it's an underwhelming minority. I'm one of those minority.

In this business, your education OWNS you. If you aren't learning new things weekly, you're barely keeping up. If you pick up something new only once a month...forget about it, you are already in my dust. I feed my family (http://www.zoe-marie.com) with this business, and it keeps me so busy I haven't had the time to work on the link I just posted. Despite all the knowledge I have amassed in the last two years (never once having giving a rat's *** about NS4, BTW :D) I still feel FAR behind. With that in mind, I have no problem relating to you folks that FOWARD compatibility is where it's at. If you are serious about this, learn something that's gonna be around for a while and USEFUL to you. Otherwise, you're really just wasting your time. If you go buy an HTML book and the first chapter talks to you about <font> tags, rip it from the book and burn it...move on the chapter two.

Graeme Hackston
11-08-2002, 04:10 AM
Jeeze beetle, no wonder you have so many smileys in your posts :)

boywonder
11-08-2002, 04:14 AM
Beetle, I'm in that minority ;)

Whammy, well said... however I gave up on work-arounds, I write stuff for capable browsers and then write a weak version with table rows, font tags, the whole bit. I determine usually through server-side detection/sessions what to code to send to the client. Anything more is a waste of time as we all seem to agree, there's more important stuff to learn.

whammy
11-08-2002, 04:35 AM
Yeah, I'm learning ASP.NET (and going for certification), it seems to be the most $$$ right now. It better be 'cause it ain't cheap to get certified at. ;)

beetle
11-08-2002, 05:04 AM
Originally posted by Graeme Hackston
Jeeze beetle, no wonder you have so many smileys in your posts :) Sorry...it's late here and I'm not sure I understand?

Graeme Hackston
11-08-2002, 05:34 AM
Is this a better explanation?

if (BeetleHasCuteKid) {
:) = true
}

beetle
11-08-2002, 05:35 AM
Ahh, hehe. I gotcha. Thanks man, she's everything to me :o