Author Topic: JavaScript Pros and Cons?  (Read 1577 times)

Dajoji

  • Veteran
  • *
  • Posts: 1058
    • View Profile
JavaScript Pros and Cons?
« on: May 02, 2008, 05:51:30 pm »
So, I'm an html noob. I've been doing some reading in order to acquire some coding skillz for website design and more than once I've come across the "be careful with javascript" warning since some browsers do not recognize it and blah, blah... but then checking lots of mainstream pages (from online stores to lolcat pages) they all contain some kind of javascript, whether to validate forms or to just make it look pretty... soooooo, what do you think? Is it really that big of a deal now or is this some kind of conspiracy to keep us scared and dumb?


Prolix

  • Guest
Re: JavaScript Pros and Cons?
« Reply #1 on: May 02, 2008, 06:05:55 pm »
It isn't all that big of a deal but you should be careful as accessibility requires the means to bypass scripting. Most people will have a browser that understands javascript but as with everything else web microsoft prefers their own syntax as does mozilla and the two do not always agree with each other nor even with the published standards from the w3c. You can get away with just using ms syntax as most of your users will use that ... unless you attract the alternative anti-ms type. The optimum thing to do is to check the viewers browser agent at the beginning of your script and then directing them to a browser appropriate script but that takes some doing. There are a great many pages out there that tell you how to go about this and even provide the code.

Good luck.

neko kyouran

  • Guest
Re: JavaScript Pros and Cons?
« Reply #2 on: May 02, 2008, 06:16:42 pm »
I believe java is cross platform supported.   and it works fine with FF once the plugin is installed so I have no problems with java.  Most of the remote desktop programs we utilize at my workspace is built on java.  so i don't see what the big deal is about it.

Mythryndel

  • Testers
  • Hydlaa Notable
  • *
  • Posts: 605
    • View Profile
Re: JavaScript Pros and Cons?
« Reply #3 on: May 02, 2008, 06:30:21 pm »
Javascript is very easy to write and very easy to exploit. It is very difficult to write Javascript well. That is the main problem with it. There are numerous problems with different browsers interpreting things differently, although this is getting better with the acid tests from w3c. There are also plugins/addons for firefox like noscript that disable ALL scripting and plugins without express permission, so you should use it to add function to your pages, but do not rely on it completely for field validation as it can be bypassed.

The biggest thing is just to find a GOOD example to start from and always be conscious of security, especially when programming for the web.

Zwenze

  • Hydlaa Resident
  • *
  • Posts: 152
    • View Profile
Re: JavaScript Pros and Cons?
« Reply #4 on: May 02, 2008, 06:51:46 pm »
I believe java is cross platform supported.   and it works fine with FF once the plugin is installed so I have no problems with java.  Most of the remote desktop programs we utilize at my workspace is built on java.  so i don't see what the big deal is about it.


java != javascript

Those two get messed up regularly. But java and javascript are not the same.

http://en.wikipedia.org/wiki/Javascript

neko kyouran

  • Guest
Re: JavaScript Pros and Cons?
« Reply #5 on: May 02, 2008, 07:03:56 pm »
meh,  i'll stick to my drinkable flavor of java myself.

http://www.youtube.com/watch?v=ggfTjfN8uVQ

Rayken

  • Hydlaa Citizen
  • *
  • Posts: 378
  • postcount--;
    • View Profile
Re: JavaScript Pros and Cons?
« Reply #6 on: May 02, 2008, 07:35:12 pm »
Javascript is good for creating dynamic web pages with basic C like syntax and flow control.  It can be combined with CSS for some pretty neat effects.  It is also fairly easy to have it interact with CGI languages like PERL and PHP to generate content based on SQL server stored data.  It does have some of the flaws mentioned above, but as long as you do your research, you can usually achieve cross-compatibility (though this does often entail writing each script once for each browser).
"Here's to lowering caskets of old friends choice and consequence we'll birth a new day with the death of an old and start over, start over.  Here's to burying hatchets in those who you'd never call your friend...we'll birth a new day with the death of an old day and start over, start over!"

Kemex

  • Traveller
  • *
  • Posts: 24
  • - If can be done, then i will code it -
    • View Profile
Re: JavaScript Pros and Cons?
« Reply #7 on: May 02, 2008, 07:43:26 pm »
Javascript pros and cons??
JavaScript pros and cons.

Do you decide to learn JavaScript??
The JavaScript Bible

You only want to create a website?
Somes Web Content Management Frameworks
« Last Edit: May 02, 2008, 11:13:08 pm by Kemex »

Dajoji

  • Veteran
  • *
  • Posts: 1058
    • View Profile
Re: JavaScript Pros and Cons?
« Reply #8 on: May 03, 2008, 06:55:09 pm »
Thanks for the pointers and links... except for Neko's link... you, tube spammer you! :P

So, if I got it right: if I'm careful and thorough with the codes a site with javascript should still work with all browsers?


Prolix

  • Guest
Re: JavaScript Pros and Cons?
« Reply #9 on: May 03, 2008, 07:22:08 pm »
That is correct. If you stick to some basics you can even achieve that with only one set of code as the various implementations do agree on 50-60% (ballpark figure) of the instruction set.

Rayken

  • Hydlaa Citizen
  • *
  • Posts: 378
  • postcount--;
    • View Profile
Re: JavaScript Pros and Cons?
« Reply #10 on: May 03, 2008, 07:28:28 pm »
To be honest, we usually just say 'forget about IE users.'  With that mindset you're mostly safe no matter what you do.  Not that firefox is 100% up to the standards, so you do risk alienating users of, say, opera.  But meh.
"Here's to lowering caskets of old friends choice and consequence we'll birth a new day with the death of an old and start over, start over.  Here's to burying hatchets in those who you'd never call your friend...we'll birth a new day with the death of an old day and start over, start over!"

Sen

  • Hydlaa Notable
  • *
  • Posts: 746
    • View Profile
Re: JavaScript Pros and Cons?
« Reply #11 on: May 03, 2008, 08:02:04 pm »
[...]
, whether to validate forms or
[...]
Just for the records: Never do client side validation, it just makes no sense at all.
.....also a saddle that won't pinch the tail. One day!

Dajoji

  • Veteran
  • *
  • Posts: 1058
    • View Profile
Re: JavaScript Pros and Cons?
« Reply #12 on: May 06, 2008, 04:24:41 pm »
Alright. Thanks. I'll take all that in mind. ::)