homepage Welcome to WebmasterWorld Guest from 23.21.23.126
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Should I use Java Script / If yes, what version
sdani




msg:1478182
 2:39 pm on Feb 2, 2005 (gmt 0)

This may be the dumbest question that someone has asked on this forum, but I need to know if I should really use JavaScript.

I have never used Java Script because for years, I thought that it may not work on some browsers and for those who are using PDA, palm etc.

My new developer suggests that a progress indicator function that I need can only be implemented if he uses Java Script.

Can you guys tell me if I should be concerned about this?
1. Is Java Script now supported by all the browsers?
2. Are there different versions of Java Script and should I use a particular one of them?

I many time see Java Script error in the status bar of my browser for other sites, and I don't want to see that on my web site.

Thanks in advance
sdani

 

korkus2000




msg:1478183
 3:59 pm on Feb 2, 2005 (gmt 0)

Javascript is widely supported, but it is not always supported. You also have to realize that javascript has different interpretations by different browsers. There is a base language though called ecma script. It is usually fully supported by browers that support javascript. Now some browsers allow users to turn off client side scripting. If done correctly you won't have errors, people just may never see the javascript content. If you want the progress bar and your developer says you need JS then I would do it.

Bernard Marx




msg:1478184
 5:30 pm on Feb 2, 2005 (gmt 0)

Are there different versions of Java Script

Yes -ish. You could say that the term 'Javascript' is a specific/proprietary term that has ended up being used generically. Think:

Biro : ballpoint pen
Sellotape/Scotch Tape : sticky tape
Hoover : vacuum cleaner (UK anyway)

There are variously named versions of this 'Javascript' that are nominally centered on ECMA Script:

Javascript - Most browsers other than...
JScript - Internet Explorer
ActionScript - Flash

and should I use a particular one of them?

You have no choice in the matter at all.
Use this attribute in your script tags

[blue]type="text/javascript"[/blue]

What language is actually being used depend entirely on the browser.
Most (practical) differences between implementations in browsers are actually differences in the browser object models, not the core scripting language (That said 'real' Javascript has some structural extras, like getter/setter properties, not available in JScript).

Trivia:
In Windows 2000/98 the "Web-style folders" feature uses HTML templates (.htt files). Even though they are an integral part of the Windows GUI, and thus will never run anything other than JScript, their script blocks carry the (depracated) language attribute declaring "Javascript". I wonder if anyone got fired?

I many time see Java Script error in the status bar of my browser for other sites, and I don't want to see that on my web site.

It is irritating, isn't it. Sun's Java website is currently throwing up "stack overflow" alerts. You'd think they'd know how to use a scripting language.

You can hide that nasty error triangle by including this small piece of code:

[blue]window.onerror = function(){return true;}[/blue]

Your unforgiveable errors will no longer be visible by the punters.

sdani




msg:1478185
 5:48 pm on Feb 2, 2005 (gmt 0)

Thanks for such a precise response guys. I turly appreciate that.

This is a great starting point for me to do more google / webmaster searches for "ecma" and now I do know that I can turn the errors off :)

Thanks a lot!

sdani

kaled




msg:1478186
 9:54 pm on Feb 2, 2005 (gmt 0)

A point of principle to bear in mind :-

Javascript should be used to enhance page functionality. You should try to avoid it for essentials because some users switch it off.

You can use the <noscript></noscript> tag to wrap html code that should only be applied if js is absent/disabled. However, you should be aware that whilst browsers are happy for <noscript> tags to appear in the <head> w3c validation will generate an error.

Kaled.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved