nefariousdesigns.co.uk — "Although Javascript shouldn’t be classed as an object-oriented language, pretty much everything within it is object based; from DOM scripting (Document Object Model) through to specific built-in objects such as Image and Date."
May 24, 2006 View in Crawl 4
sanityinanarchyMay 25, 2006
JS is also flexible enough that -- like Ruby -- it shouldn't be too hard to implement whatever features are lacking.Well, that's a guess. Could you provide some examples of syntax you don't like, and what you'd replace it with?
bpapaMay 25, 2006
I'm by no means a Javascript guru, but the recent "AJAX in Action" book really opened my eyes to a lot of things that I didn't know about js. I think it's a worth a look whether you are interested in building AJAX apps or just want some extra insight into js.
covertbadgerMay 25, 2006
@Jerf - have you actually tried running the code you claim is non-functional? If you understood js as well as you seem to think you do, you would realise that the line 'this.getArea = getArea;' in the circle definition makes the getArea function available, thus 'obj_pizza.getArea()' is perfectly legal and works as expected. I suggest you brush up on your programming skills before spouting off in future.
sandrat44May 25, 2006
Well said, long.... but well said.It's been a while since I've had to code in JS, I got promted and have to see over the work of others and manage projects... boring as hell...speaking of nuances, the one thing that really torqued me off was the NN/IE c**k-fight to dominate the browser scripting language and having to browser check due to slight differences in DOM... I'll check with some of the other developers around here, but has this issue mellowed out yet? I still see some browser checking code floating out there...
armbarMay 27, 2006
I'm not trying to comment-spam here, but there's a lot of info about "new" things you can do with JavaScript in articles across the web--I don't think you really need to go buy a book unless you want something to read on the crapper. We have a pretty good collection of articles in my Magnolia group: <a class="user" href="http://ma.gnolia.com/groups/AdvancedJavascript">http://ma.gnolia.com/groups/AdvancedJavascript</a>
armbarMay 27, 2006
No, the issue hasn't really mellowed out yet, but there are things you can do to avoid browser detection, which is evil.The majority of DOM based scripting is the same--most of the time you'll be using getElementById or getElementsByTagName, which work in every browser on the planet (basically). The major differences for application development, in my opinion, are in event handling and Ajax calls, but of course those can be wrapped in another object. Prototype does this automatically for you if you're feeling lazy.Just don't revert to the bad old days and start using IE's DHTML scripting (a la document.all, etc.). Those are the proprietary functions and properties that aren't widely supported.
harry4000Jun 10, 2006
There are at least two super common misconceptions about JavaScript:Eye opener #1: JavaScript is OOP. JavaScript, ActionScript, ASP/JScript, and Windows Scripting Host have the same fundamental power as every other OOP language. ECMA just needs to market these 4 languages better. If you don't know who ECMA is and what they have to do with all this, then that's my point. They're too humble about the standards they've created.Eye Opener #2: Why do people waste their time and clutter their code by terminating each JavaScript line with a semicolon? Semicolons are functionally useless and your code would work just fine if you destroyed every one of them. I'll let you know if I ever decide that my code needs Christmas decorations, but until then no semicolons for me.
uselesspicklesJul 27, 2006
One good reason to terminate every line with a semi-colon is that the code will still work properly if you strip out all comments and white-space to reduce the code size. I think the decision to make semi-colons optional at the ends of lines was a bad decision - probably because the language was initially designed to be used by non-programmers that would be more likely to forget semi-colons.