Should JavaScript Get More Respect?
An anonymous reader points out an article in IBM's Crossing Borders series about the language features of JavaScript, surely the Rodney Dangerfield of scripting languages. But with increasing use in such technologies as Ajax, Apache Cocoon, ActionScript, and Rhino, some industry leaders are taking a fresh look at the language. From the article: "Nearly every Web developer has cursed JavaScript at one time or another. Until recently, many developers had all but written off JavaScript as a necessary evil at best or a toy at worst... But JavaScript is becoming increasingly important, and it remains the most broadly available scripting language for Web development."
it remains the most broadly available scripting language for Web development.
:)
As someone who has written applets with over 25,000 lines, I can easily agree. Out of the roughly two dozen languages (scripting, etc.) that I know, JS has been a cornerstone of both simple and solid applets and the quick & dirty prototype. Let's hope the future agrees
It looks awfully familiar.
http://outcampaign.org/
According to the article
"My friend and colleague Stuart Halloway, one of the foremost experts on Ajax, begins a JavaScript class with a provocative statement: "By 2011, we will recognize JavaScript as a language with a better set of features for developing modern applications." He then says that JavaScript programs are often 10 times as dense as similar Java programs and goes on to show the language features that make it so."
The author seems to equate dense with good, not an association I make
- It is not possible to have two methods with the same name and different parameters (only one of those will ever be called).
- On the other hand methods behave like objects. One can have arrays of methods and then call mymethods[2](param);!
This is just plain weird.
Lately it is like as if some circles are almost pressuring the developer community to pay more attention to java, javascript and affiliated stuff. Every now and then someone pops up and says something to that effect and chaos ensues.
I just dont get why ?
Theres something called freedom. If something is useful for developers, they like it and they use it, and they think good of it, they pay it respect. If something does not catch their attention, or they think its not to their liking, they just ignore it.
I just dont get why are we being pressured to look into matters java, javascript. If they are respect-worthy, they will earn the respect by themselves good enough. If not, noone can make developers to respect something by propaganda or by coercion.
Read radical news here
In the opionion of a retired Windows cleaner: NO!
Feared? YES
Hey guys. I'm an online gamemaker, so 'toy' languages are right up my alley.
The main problem with writing games with some of the most applicable web tools out there (Javascript, Flash) is that once it hits the web anyone with access to the View Source command can steal your work and throw it on their own site as theirs. This is highly discouraging.
Nowadays I do use Javascript and Flash extensively, but the most significant part of any game machinery is always on the backend somewhere, usually in PHP.
allow me to elaborate, suppose you want to know if the version of the language on your platform supports an intrinsic array push function, and if not, attatch your own: firstly the reference to
sticking with arrays you can grow and shrink them with little to zero fuss: magically the array is one index longer. you can just set arr.length and it will append or delete indexes for you.
you can also use this to assign functions to other object's handlers, most notibly events But this has brought up the thing that really really needs fixing, suppose i want that onclick function to pass some info to myFunction when i call it i have to do this so instead i've created a function inline to hold my custom function, firstly it's not immediatley obvious to what object the "this" applies. if i'm running this code in a class does the this mean the class or someObject, one hopes it means the someObject.
next is the scope issue i've talked about suppose i'm dynamically creating objects on the fly and want the callback to reflect the id thus every single object will pass the value of 10 to myFunction, because after the function has finished the instance of i in memory that was used is still sat there and every myFunction has been given a pointer to it, not the value it was when it was initialised!
so some oversights still exist, if only there were ways you could explicitly state "pointer to" or "value of" like in, oh, every other language including visual basic
If you don't risk failure you don't risk success.
The expression you're looking for is Lowest Common Denominator
What a piece of shit that language is.
Be wary of any facts that confirm your opinion.
JavaScript/ECMAScript really is an interesting language; the way objects work takes some getting used to, but it's powerful, and definitely definitely not a toy language. It's when you bring the HTML DOM and browser inconsistencies into the equation that things start to get painful.
JavaScript is an absolutely great language marred by the fact that people can't distinguish a language from its library. When most people say "JavaScript sucks!" they are really saying "DHTML/the DOM object model/HTML/CSS sucks!".
What I don't get is why developers use PHP, which looks like it was thrown up after a frat party. JavaScript would fill the bill as a decent language with a C-based syntax much better.
... it's not because you have to use it, that it makes it a good language.
Only reason people are using it, is because it's the only thing that let you manipulate a web page and will work more or less for 99% of the people out on the internet. Would all browsers ship with only COBOL people would be using it. Would I have the coice between JS and let's say Python or Ruby, I wouldn't even have a look at it.
Sadly, when Javascript gets mentioned most people think of browser scripting. That's like thinking of MFC every time C++ gets mentioned... :(
What sorts of shells interpret JS? I know of Mozilla's js shell, and they also have a xpcshell (which adds XPCOM things to make it fully Mozilla-y). Sadly js shell has no built-in file access (it's a compile-time option you have to jump through hoops to enable, and buggy), and xpcshell has lots of XPCOM baggage.
Are there any others using different engines? Anything from Adobe (ActionScript) maybe?
The inconsistence between the two major implementations, Mozilla and IE. And the huge amount of annoying bugs that IE has.
I don't hate JS, its a rather nice language, but I tend to keep minimal use of it on my applications because I really hate to lost one entire day fighting against IE.
---- You know how some doctors have the Messiah complex - they need to save the world? You've got the "Rubik's" complex
can you say DOM compliant?
-=[ place
You may well be right, but
"It's multiparadigm: supporting imperative, object oriented, and template metaprogramming styles"
Is just too geeky for me before my second cup of coffee.
javascript is too hard to unittest but most of that has to do with the web browser container . javascript is a victim of its environment.
Any serious Ajax application.
It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
I am one of those people that cursed JavaScript (after being enthusiastic about it when I was 14). I am just now beginning to turn around and think "well, it IS pretty nice". One of the things that has changed is that it does not "[mutate] faster than a fruit fly in an X-ray machine" (bonus points if you know who wrote this) anymore, with support becoming more standard over different interpreters, and incompatibilities becoming better documented and workaround libraries that unify the differences all over the place. Debuggers also become more widely available, helping the people when they exclaim "WHY the HECK doesn't it work this time!". It's still easy to shoot yourself in the foot with it, but hey, the same goes for C. At least it generally does not blow your leg up like C++. This behaviour is caused by the extreme felxibility of the language, which also allows for interesting constructions, as long as you're careful as a programmer. In other words: you have to know what you're doing to keep the code organized and understanable, something that is lacking with most starting web developers. Still, the availability and functionalty of JavaScript allows rich, interactive web applications to be developed, which is a good thing if you ask me.
That isn't really an oversight, it's the way closures work. Most functional languages let you create closures explicitly so the problem doesn't arise. Javascript does it automatically, and usually when you don't expect it. In Javascript, you can do:
That creates a closure for each handler, with its own copy of i, so they will all get the values you want. I have no doubt there are other ways to do it, but this works for me.
JavaScript should get more respect, XSS-holes are one of the most prevalent and useful attacks against websites there are.
I for one Hate our new Javascript writing overlords.
And for the record im suppose to be writing various Javascript programs at this moment.
Javascript is a fine language with elements from functional and object-oriented programming. The problem with web development is the whole environment:
1) the coupling of the UI with the code that actually does stuff.
2) the non-efficient and error-prone methods of communication between client and server.
3) the non-existent security regarding JS code; anyone can see it.
4) the mixing of a tagged document language with a programming language.
Ideally, web applications should only consist of source code in one language which is clever enough to be able to provide all the necessary abstractions. In reality, such a language does not yet exist, making web applications development 10 times more difficult than what they should be: the minimum number of languages to use for a web app is 5: 1) html, 2) css, 3) javascript, 4) java/php/ruby/python/perl/whatever, 5) XML...and let's not count the various XML schemas required for various domains of the back end, because the number of 'languages' one needs to know will grow exponentially!
My wish for web 3.0 is that Javascript is replaced entirely. The ONLY thing that Javascript has going for it is ubiquity (which I guess is down to its ease of implementation). Its not all Javascripts fault, in general, as in most things webby I blame Microsoft, but hte language itself seems to make everything you write look lke a dogs dinner.
... end
Wouldn't the web be a nicer place if you could script the browser using Ruby or Python? Can you imagine the fun you could have working with constructs like:
@page.findById( "myID" ).each do |ajaxReturn|
The web could be beautiful. Next on my hit list is an improved HTML / CSS. Should rounding corners, or drawing shapes / shadows really be done with gif/pngs?
Scared of flying, pointy things snce 1979!
Respect is earned, not given. As far as I'm concerned, AJAX has given JavaScript a new lease of life. Without it, there would be no Gmail, no Google Maps, or at least not in the way we've come to admire them. When you see the fantastic stuff Google (and Windows Live for that matter) produce, XMLHTTP was the catalyst that made that possible, but all the donkey work is done by JavaScript.
Thus I have a lot of respect for it as a client scripting language, in most cases it's the only way of getting something done in a browser.
Javascript is anything but dense. The most impressive part about the various flexible agents is that they are easily understandable programming patterns. That makes it very easy to make an assessment for which methodology you will employ.
"Progress comes from the intelligent use of experience."
yes
On second thought, let's not go to Camelot. It is a silly place.
It looks awfully familiar to me.
Look at the history of Javascript. It's not the history of a programming language. It's the history of a marketing battleground.
Programming Languages have a few key elements that Javascript lacks. For one, everyone who writes Perl, Ruby, Java, Python, even Bash expect it to have consistent behaviour where ever it might be. And for that behaviour to be well documented, reliable, and owned by the language itself.
Javascript has an evil dependency to run based on the Operating System and Browser that you are using. Mozilla on Windows works differently than Mozilla on Linux. Mozilla on anything works different than Opera or MSIE. MSIE6 works differently than MSie7. And some of these differences in javascript behaviour isn't really javascript. It's javascript trying to do CSS/DHTML stuff.
If you were to have something similar under a real programming language there would be an active development team working to resolve the differences and get consistency in the language. The finest example of this is the Java JVM. It tries to be write once run anywhere. I don't know that it actually accomplishes that -- but it's closer than javascript.
javascript has no such activities. I don't do much with Javascript but when you pull a 10 year old book off the shelf you find 1/2 of it is talking about MSIE vs Netscape in how to work around code differences. Then you get a new Javascript book and it's still talking about many of the same problems a decade later. That's a dead language lacking any real development.
AJAX is cute because Microsoft went ahead and implimented something on their own and didn't bother telling anyone about it. I'll assume that Mozilla implimented the exact same thing but under a different name because they were afraid of getting sued. Why they did it doesn't matter. The fact that they implimented the exact same thing under a different name is why Javascript must fail. It's not a real language. You won't find a language the does the exact same thing in two different commands and those two different commands only work on distinctly different machines.
If someone takes Javascript away from the companies and starts to impliment there own version of it there's no chance. Javascript needs a replacement.
While I agree that some of the concepts you mention could be useful, I don't see that Javascript's implementations are particularly powerful or elegant.
It's hard to comment on the function-attaching example you gave, since obviously any real implementation of most languages already has functions such as those you describe. In general, however, I've found these dynamic features to be overhyped, and usually no substitute for having a decent design in the first place. I don't miss them in languages where they aren't there.
As for the scoping and closure stuff, IMHO having first class functions in a language is a big plus. Javascript's version always seems a bit like Functional Programming Lite, though: in real functional programming languages, the rules on scoping and such tend to be absolutely clear, and the syntax clean and powerful. So-called scripting languages tend to try but fail on this count here; Javascript is certainly not alone in the field.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
def foo(n)
n.method('+')
end
You were saying?
Be wary of any facts that confirm your opinion.
If you are sending information to the browser that you don't want to be known, then you're doing something wrong. This is the case for JS, as well as for AJAX, Flash or Java applets. Or client-side code in general.
Seriously, I've seen students faces turn white when I mention that I could log into and mess up their remote SQL database, thanks to them putting their (administrator!) username/password combinations in client-side Java bytecode. They would then try to obscure their passwords somehow, which leads to an arms-race with other teams trying to break in. Security can be loads of fun!
This sig is intentionally left blank
I've been a web developer since summer 1998 and not once have I ever thought JavaScript was a "necessary evil", I have in fact said many times that JavaScript is God's gift for web developers. It's my fav language and I have used it to create many unique web experiances.
Wrong, you do not need to know XML. I write "AJAX" applications at work all the time and haven't used XML for months. Look up JSON and make your life better.
Remember that with XMLHTTPRequest you are restricted to your own domain, so more often than not you are in charge of the message encapsulation language. You only have to make it as complicated as you want to.
On a slightly weaker note, some people are lucky enough to drop CSS from that list as well. Frequently I work with a designer who takes care of all the CSS for me - all I deal in is IDs and classes.
I've been using PHP and Perl server-side and, reluctantly, JavaScript client-side for years before I actually bothered learning JavaScript. When I finally did, I discovered a language which was similar to PHP and Perl in that it supported most, if not all of their language constructs and which in many ways was more elegant (IMHO). So my dream was to use JavaScript both server- and clientside. That can be done in .net/mono, I guess, but I prefer the lightweight nature of PHP, Perl, Python etc. So I started http://www.sf.net/projects/jsext - check it out! The plan is to support C libraries (done on Linux, Windows version under construction) and Python modules (not done). There are other, similar projects, too: http://en.wikipedia.org/wiki/Server-side_JavaScrip t
Javascript has been used to do so many things, I dare say most web developers have used it with great success to complete a wide variety of projects. But until further improvements are made to it there is no need to give it "more" respect.
in a word, NO. JS is slow, cumbersome and i can't stand it.
If you mod me down, I will become more powerful than you can imagine....
C-like ugly syntax...
weak typing...
No. No respect.
I may use it, but respect it? Nah...
http://www.dieblinkenlights.com
If you don't risk failure you don't risk success.
such language exist and become more and more common.
Google already released their gwt (http://code.google.com/webtoolkit/) but there are also other languages like HOP (http://hop.inria.fr/) or Links (http://groups.inf.ed.ac.uk/links/)
I used to hang out on the , and questions about encrypting Java bytecode came up with surprising regularity. The number of people who simply didn't understand that what they wanted - to make it impossible to decompile the bytecode back to Java source - was impossible was quite staggering. All sorts of plausible-sounding solutions were mooted, but they are all ultimately worthless. As long as I control the hardware, there's nothing you can do to prevent me from seeing data processed by it, all you can do is try to make it difficult.
It's official. Most of you are morons.
Can someone explain these to me since I'm confused. The article states:
"This example shows that I can treat a function just as I treat any other variable. C developers think of this concept as a function pointer, but JavaScript's notion of higher-order functions is much more powerful...
[snip]
Using a function as a function argument, or returning a function as a value, elevates this abstraction into the realm of higher-order functions. "
Whats so new and powerful about this? Using the C example you can easily return function pointers as arguments from functions and pass them too functions as well. So why is javascripts method so much more powerful that C's? Using a standard C compiler you could also pass to the same piece of code function pointers to functions with variable arguments(though I suspect a C++ compiler might complain about this).
Not sure what his point is.
I did it for the money...
Beside the lack of a good way to debug your javascript code (using traces, not the infamous alert method), I really miss printf like functions. Why was this not available in the base language is beyond my understanding.
Anyway, if you're like me, you can use my own implementation of printf functions here.
JavaScript has one really, really nasty flaw. It "recycles" the + operator (which usually is used for adding numbers) to concatenate strings. In some languages (e.g. BASIC), which treat numbers and strings as distinct data types, this is not a problem. But JavaScript is dynamically-typed -- in other words, you don't have to tell it what is a number and what is a string; it tries to work that out for itself. And this is the source of the error. When you innocently write
document.theform.hours.value += 1;
in a bit of form-munging code, what happens is that a figure "1" gets appended onto the end of the value in the "hours" box. If you want to increment it by one, you have to use something like
document.theform.hours.value -= -1;
which is mathematically sound, but looks very weird.
JavaScript really needs a dedicated string concatenation operator, in recognition of the fact that numeric addition and string concatenation are different operations. Unfortunately, the "dot", which would be the most obvious choice as it's already used for the concatenation operator in other languages, is already very much in use -- not to mention that changing an operator in this fashion is likely to break things. And the breakage will be even worse than register_globals in PHP, since JavaScript runs on the client side -- meaning no webmaster can ever know for sure what JavaScript engine is in use.
Je fume. Tu fumes. Nous fûmes!
Ooh, nice unclosed anchor tag there. Teach me to not use the preview button - and to get 3 hours sleep...
It's official. Most of you are morons.
I agree that javascript is not *the* problem of web development, but it has itw own bag of oddities.
// Did you really expect the 'i' variable to contain 20 here ?
Here is one: variable scope:
function MyFunc()
{
var i=0;
{
var i=20;
}
}
Call me old fashioned but K&R will always be my definition of simplicity and power in programming.
The thing that makes it messy in C is C's strong typing, you would have to pass and return everything as strings, but this is to be expected since the problem is contrived to demonstrate the brevity possible with weak-typing. The trade off is that you don't know exactly what your dealing with. In well written scripts that's no big deal, in a system with thousands of source files written by dozens of programmers it will quickly turn your brain to mush.
It used to be that weak typing in a language was a BadThing(TM), now it's a "feature".
And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
Beside the lack of a good way to debug your javascript code
Ahem.
FireBug.
It is a pity that someone not very informed writes an article on the JavaScript object model. The JavaScript object model is a copy of the object model of the Self language developed in the 80s. There still a link to the Self language to the Sun web site. There was a reason to create Self language object model and it is not bad at all if features such dynamic binding are needed. Whether a generic purpose browser script language needs such a model is another matter. Nevertheless, most of the developers use a minimum of the features available, and once a while someone seems to rediscover it - come on this object model model is more than 20 years old - and JavaScript has been for around 10 years now with this very model. The original JavaScript documentation by Netscape had an entire chapter on JavaScript objects, that is still the best tutorial available for the Self object model.
JavaScript, surely the Rodney Dangerfield of scripting languages.
I don't get no respect, you know, the other day I told a friend that I wanted to try out the online dating scene, and he set me up to use Outlook Express on Usenet!
Lil' Thindime, lilting a lacrimose lament, krashes the kwaint konfines of Kokonino Kounty
I never touched JavaScript myself (well, to open and close a window, which is only an example I grabbed from a website) yet have been annoyed at people who didn't even manage to seperate Java from JavaScript. When it comes to web programming I've only used Java thus far through jsp or full servlets. Still, JavaScript is absolutely an important issue. It allows for server-side scripting without the hassle of a full container (in my case java container; tomcat or glassfish).
Still, what company knows best about JavaScript than Sun themselves? Recently the latest version of Java (Java SE 6) has been released and guess what one of its keyfeatures is? An API to support scripting languages. Right now the so called scripting engine only supports JavaScript, read about it here. For those really interested, here is the API documentation (javadoc).
I know I'm biased but heck; if people still don't realize the possibilities of JavaScript I'm pretty convinced that the combination of Java and JavaScript will enhance some of it. Java SE6 is pretty extensive, and with the addition of JavaScript even more flexible.
The problem is not the environment, it is your inexperience. HTML and CSS are for markup, the interface. Javascript is for behaviour. The back-end language is for the controller and the model. Stick to well known paradigms and you'll do well.
This degree of seperation is beautiful. I wish it was that easy for client applications too.
As we all know, programmers are most productive in assembly, which is by nature many times denser than any programming language.
Oh wait! Never mind assembly, lets just do binary.
---
"The chances of a demonic possession spreading are remote -- relax."
And Ajax is worse. Now I can be writing an email in gmail, hit back to check something, and bye bye everything.
I agree that there are sometimes compatibility issues with complex Javascript, but I think you overexaggerate Javascript's flaws.
As a language, Javascript is simple, but has a very rich featureset. The standard libraries allow it to interface with the DOM of a HTML page. The only significant problem I can think of is Javascript's lack of thread control structures, which may prove problematic for applications that handle complicated asynchronous events.
I'm not sure why you think Javascript is "being used for ridiculous things that it was never really designed for", as it's a rather generic scripting language, and its standard library is small and to the point. Could you give an example of some of Javascript's perceived shortfalls?
JavaScript is a developing and well-defined standard - ECMAScript. It's no less standardized than, say, CSS, and as a practical matter, JavaScript is generally less variable and more predictable across platforms than is CSS.
Nor is JavaScript necessarily slow. In fact, it's quite fast in many cases when you consider what it's doing. If all you do in JavaScript is time loops, you should be using a different language.
Google has demonstrated that JavaScript can be translated (compiled) into other languages, Java in the case of GWT.
There are JavaScript shells that you can use as a means of writing command-line applications in JavaScript (more or less).
Now, what I'd like to do with JavaScript is be able to write client-side applications with it. I want to be able to do file i/o (and so forth) locally, without running a local web server. Make it a full featured "normal" programming language with access to local resources except that it is, of course, running via a browser and/or able to manipulate a browser's DOM. Having to use a mini-web server running locally, or *cough* XUL, or whatever, to do this is so 20th century.
JavaScript is a nice language with unique abilities and applications, and it is the only language with a well-known and widely used interface to the DOM. If you dismiss it out of hand, you are dismissing it out of ignorance.
> if( !Array.push ) ... }
;)
:)
;)
;)
:|
> Array.prototype.push = function( item ){
Yes, this sounds nice, but it's a large pitfall too. It's very tempting to start extending 'basic datatypes' with all kinds of stuff, which can result in awful clashes with other libraries that do the same. Ruby on Rails' 'Prototype' library is a good example of how _not_ to use this.
> someObject.onclick = function(){ myFunction( this.someAttribute ) }
Horrible indeed. The idea of allowing to call a method with a different 'this' is already scary, and useful only for nasty hacks, but I think actually using this feature in very commonly used functionality* was a big mistake (perhaps not so obvious when 'object oriented' programming (yes, the prototype stuff, i know it's not strictly oo) wasn't very common, but nowadays it's one of the first walls JS developers bump into).
> function array_push( arr , item )
> arr[arr.length] = item;
Nothing new here I think... There's more (intepreted) languages that can do this. And most other languages actually _do_ implement push() (or something similar) on all platforms.
> someObject.onclick = myFunction
Nothing new here either. Try Python for instance, which is a lot more dynamic than JavaScript...
Yes, I understand that JS has certain very nice features when you're used to more static ones like C or Java or whatnot, but I think compared to certain others (note that most of JS' features are in some way stolen from other languages) its awful implementation, lack of basic functionality (no String.strip() while there is a String.blink()?!?), sheer unintuitiveness (it's for instance not at all clear what notation to use for 'OO', there's a billion ways to define objects and prototypes and such, and the differences are subtle) and strange quirks (like the nested scopes example you mention, but there's plenty more examples) are reason enough to still see it as 'necessary evil' rather than 'an enlightening experience'...
(Do note that I'm a bit biased, as I'm (not deeply, but a bit) involved in the PyPy project, which works on (among a lot of other things) a Python to JavaScript compiler...
* most notably event handlers: when registering an event handler in certain ways 'this' points to the event, or the element on which the event is defined, or something, and not to the object, making that you need to use closures to actually have a reference to the object the method is defined on, from the method
I'd like a JavaScript based shell for my shell programming tasks. At the moment I'm confined to either bsh/ksh or perl. The shells [bk]sh are just too limited for many tasks, perl just has a too wierd syntax for many things.
The obvious answer is 'just do it', but this need time and between work and famliy there is not much left...
Markus
This doesn't have a neat solution. However, there are various ways to get around the problem you descript. For instance, under prototype, one could write:
The best and worst part of javascript is the client side scripting. Unlike just about every other language, you don't get to pick the best implemented compiler or interpreter or platform for your program. Rather, whatever web browser happens to pull up your page today with a half implemented javascript spec is what you get. You can't just test every piece of code you write, you have to test every piece of code with every platform and browser you plan on supporting. And as bad as that is, there just aren't any better options for cross platform/browser support for client side scripting that are built in.
Maybe you hope so, but I don't. The "this" is lexically inside whatever environment the whole line of code is in, so it should refer to whatever object "this" refers to in that environment. At least, that's what lexical scoping dictates and what makes the most sense to me.
Please correct me if I got my facts wrong.
Javascript Closures: has a nice tutorial. In this case specifically, you can follow the event-handler system he's created. You could also look at the prototype.js library, specifically the "bind" function (function extension).
foo.onclick = this.DoSomething.bind(this, arg1, agr2);
Now onclick executes "DoSomething" using the current "this" as the context, and stores the args. Not only is this very useful, but it avoids the memory leaks in IE caused by combining inline functions, DOM elements, and closures.
It sounds like you want a standardized version of Javascript. There is one; it's called ECMAScript. Where the problem lies is that different browsers may have different standard libraries, so a standard function in IE, may not exist in Firefox and vice versa.
However, as far as I know, most browsers adhere to the EMCAScript spec fairly closely in terms of syntax, even in IE. So the language is a fixed standard, and certain libraries (such as the W3C DOM model) are standards, but that doesn't stop individual browsers either extending the standard libraries, or screwing up the implementation of the libraries they support.
You can do some pretty fun things with it, such as a true 3d engine, a raytracer, games (careful, robots is addicting!), out-of-order CPU simulators, and other stupid things without any plugins - all the user needs is a halfway decent browser.
My server
It's hard to comment on the function-attaching example you gave, since obviously any real implementation of most languages already has functions such as those you describe.
A real world example you may find more enlightening: There's a framework out there somewhere that extends the standard Javascript classes with methods that are API-compatible with the standard methods of equivalent Ruby classes, meaning that simple Ruby programs can often be run with few or no modifications.
Another thing you can do with this capability is use it on your own classes. Consider plugins that directly add new features to existing objects.
I really like JavaScript, however when I did complicated things with it, I ran into a some problems with Memory Leaks in IE. Getting rid of which was not that easy in some case, thankfully there are tools like Drip http://outofhanwell.com/ieleak/index.php?title=Mai n_Page I guess some of these things were fixed with IE 7...but you know it was not fun.
I've noticed it with Perl, Python, Ruby, Pascal, C, C++, Java. Well pretty much every single language I've ever come across except for the Unix shell.
They start off as small, fast, flexible, perhaps even elegant languages and evolve into massive bloated, and unweildy oil tankers which are too large to fix. So we start from scratch with a whizzy new better language which just needs a little tweak here or there to make it perfect.
Deleted
Programmers don't really hate JavaScript, we just yell at it like we do any other programming language when we can't easily do something that we want done easily, like searching substrings. In truth, JavaScript is a great tool that allows the ability to create powerful webapps that have the look and feel of traditional standalone apps, and anyone who says the genuinely hate it is either lying due to anger at something related to it, or don't use it enough to understand its usefulness.
Student Manager - Take control of your education!
Javascript is also the heart of the Sphere gaming engine. http://aegisknight.org/sphere
Argh! Where is the mod point when you need one!
I even remember some people telling me that POST request is more secure than GET since client can see contents of GET request in URL. These people worked for serious web company, btw. I'm afraid that Security through Obscurity is still the way most people see it...
May Peace Prevail On Earth
Javascript has some amazingly powerful functional features that make it rival some of the great languages. That said, it is hampered by a lack of true object orientation. There are syntactic hacks that allow you to *fake*
It strikes me, however, that one of the best scripting languages out there, python, took a similar path. Once python had no object orientation, and people faked it with syntactic hacks. Then the syntax changed slightly and it was slowly added over the years, even as compatibility was kept with previous versions.
Javascript could take such a route. It's not a bad languages; it could get better.
"Times have not become more violent. They have just become more televised."
-Marilyn Manson
That's an oddity?
The only people for whom nested variable scoping is an oddity are those whose main language is BASIC.
> 10 times as dense means the developers are 10 times as productive.
g uage)
Not really. Have you ever used APL?
http://en.wikipedia.org/wiki/APL_(programming_lan
It's extremely dense but if you discover a problem with your code a week after writing it, good luck trying to debug it.
function MyFunc()
{
var i=0;
{
let i=i+1;
alert(i);
}
alert(i);
}
You would see "1", then "0"
lexical scoping in ecmascript is very simple, to support the construction of closures, as it is primarily an event handling language. The let keyword would provide a built-in way to introduce a blocking scope (it is possible now, but it involves defining an anonymous object and using a method scope, IIRC)
That being said, the cases where you need such a construction are fewer than you would imagine, as it can make code intent unclear.
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
What's this?
Tools...Options...Content...Un-Check "Enable JavaScript".
or
Tools...Internet Options...Security...Internet...Custom level...Active Scripting - Disable.
Oh my, all my JavaScript applications I spent hundreds of hours developing no longer work! What will I do? How can I force my users to enable JavaScript? Oh, you mean I can't? Well I guess those hundreds of development hours are wasted aren't they?
If it must work, then it must be done serverside which is under your control. Client-side scripting is strictly for completely non-essential frills.
Not to mention that the whole memory and sluggishness issues of Firefox are due to the absurd reliance on JavaScript.
Until browsers no longer allow JavaScript to be disabled (I rue the day) then it is useless as a reliable tool for web application development.
Now were someone to release their own browser where JavaScript cannot be disabled and their server will only recognise this browser, then it would be useful, but we all know what happens when you try and force a particular browser on users...
I've decided in the last year that JavaScript is the unsung hero of computer languages. The biggest reason I feel this way is: JavaScript lowers the bar for program distribution. If you write a program in Java, the bar is high because they have to have a Java interpreter. Same for Perl, Python, Ruby, Flash, etc. If you write in a lower level language like C, C++, etc. you still have to get the program installed, and you have to tailor for their architecture.
I'm a math teacher, and I considered once writing a web article for folks about a topic that would require solving an equation (and not a simple one that could be done with algebra). The obvious support program for the article would be a program that could apply the secant method and approximate the answer, because close is good enough.
I considered writing a little CGI equation solver, but this was unsatisfactory to me. I'd have to take care because I'm letting other people run code on my server. Then it occurred to me that I could write it in JavaScript, and it would run on their computer.
If your program can be done in JavaScript, there is no simpler software distribution model. Click the link and it's going. Nothing to install. It doesn't get any easier than that.
Verbosity and density really aren't all that closely related to readability and maintainability. I submit as evidence the fillowing: assembly language, C, Perl, and Haskell.
My sense is that, if two languages are about equally readable, the one that is more dense ("expressive") will produce more maintainable code simply because there's less to read and keep track of.
Like all active content, JavaScript is a severe threat to security.
Web Developers need to be aware of the risk. Do the right thing, do not use JavaScript to protect your website's visitors.
Java Applets did all this, but Microsoft got their grubby little hands on it and destroyed it.
Sun nailed the concepts with Applets. It's very unfortunate that they got such a bad name in the beginning.
I've been trying to put something like this together for ages. It has been a perverse dream of mine to do system management from javascript for the longest time. This totally rocks. And with dynamic binding? GLEE
I problem I never figured out (and which always kept me from getting anywhere) was how to reconcile threading/forking with the spidermonkey engine in a way that could be manipulated cleanly from the scripts themselves.
Any thoughts on this?
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
*Axiom #7 of Programming Lanaguages (A7PL) states that scripting languages are the Chevy Chase of programming languages in general.
As someone who just finished writing my first javascript app, and a simple one at that, I can tell you that I appreciated the simplistic language. I've got roots with BASIC, Turbo Pascal, and have dabbled a little along the way, and I have to say it was intuitive.
I'm not a web-dev guy, and the script I wrote won't even touch a http server, as its only meant to work locally, but I liked it.
just me rambling
harryk
think before you write, it'll save me moderator points.
Personally, I feel that javascript is a wonderful well thought out language. It's easy for starters, yet it has the power that professionals want and need. Alot of people talk down about javascript because browsers don't all integrate it the same, or correctly. but javascript give you to tools to get around the short comings of the browsers.
I think the problem here is your mental model, rather than the language. Specifically, you are thinking that the value of form field, which is a string, should be treated as an integer any time you want it to be. Admittedly, JavaScript does a pretty good job of doing this sort of implicit type conversion for you, but it can't always guess correctly. And, when it doesn't (or when you suspect that it might not) you should do the conversion explicitly.
Keep in mind that the example you cited (adding an integer to a string) would not work at all in most languages. While JavaScript makes a good guess at what you want, you really should be checking the value for validity (the user might have left it blank or typed in "Bob slept here" instead of giving the integer you were expecting), converting it to an integer with parseInt(document.theform.hours.value,10), and incrementing that.
--MarkusQ
Javascript will forever be the bastard stepchild as long as there's all the incompatabilities between platforms. Hell, even the standard APIs have different semantics. Until you don't have to code up three version of every function, JS will linger on the edge of respectability.
I've recently started tooling around with creating some in-house Firefox extensions. They don't really do anything to extend Firefox so much as they are applications in and of themselves. As a result, I've had the opportunity to dive back into JavaScript. I must say, I've been able to get quit a number of things done rather quickly, and the results are easily distributable in a cross-platform format.
With applications such as XULRunner, distribution of JavaScript based applications could get even easier.
One of the things that's greatly lacking for non-web applications though is database connectivity. The things I've worked on so far have had to connect to a web server in order to get anything done with SQL. It still works great, but it would really be nice not to have that extra layer of complexity.
-B
Markup is programming as well.
In order to fully comprehend how a web application works, you need to know all its subsystems, including markup.
Ouch. In a thread about web development, too...
var human = new Object();
var ass = new Object();
var head = new Object();
human.ass = ass;
human.head = head;
human.ass.head = head;
Perfectly valid in Javascript, and in the real world.
-Todd
Put down the sig, and step away from the computer.
The most amazing thing about JavaScript is the number of people who don't really use it, but have very strong opinions on the subject.
JavaScript is a very powerful, flexible language. Like any other powerful language, you can get into trouble if you're not careful. Bottom line is, if you can't write good code in JavaScript, YOU can't write good code. It has nothing to do with the language.
Considering the differences between the implementations, you could say that JavaScript is the most important half-dozen or so almost identical languages on the web.
What sound do people on rollercoasters make? Hint: it's not Xbox 360.
I have a hard time understanding why I hear so many people complaining about JS as a language. I think a lot of Java programmers don't like it because it's not Java (not strongly typed, ...), and a lot of C++ programmers don't like it because it's not C++.
The truth is that you can do some pretty amazing stuff with JavaScript. My favorite demo is here. It's a web-based calculator, and if your browser has MathML set up correctly, it'll display your equation on the fly, as you type it, in standard math notation. For instance, if you type 1/(2+pi), it displays a fraction bar, with 1 on top, and 2+pi on the bottom (pi rendered as a Greek letter). (I think recent versions of Firefox have MathML and its fonts set up correctly by default, but if not, you can download the necessary fonts (instructions). For IE, you need to install MathPlayer.) What I think this calculator app demonstrates pretty dramatically is how powerful a development platform the web browser can be, without messing with the ugliness of AJAX at all. WYSIWYG mathematics typesetting is the kind of application that people used to pay $100 for ca. 1995, and now it's not only free, it's open-source, and it's an app that you can just run in your browser, without having to install anything.
Find free books.
Javascript really isn't that bad as a language. It's fairly close to Python in capabilities. With a little bit of work, Javascript could grow up to be Python. It wouldn't be a bad thing if the client and the server spoke the same language. Flash and Firefox now have just-in-time compilers for Javascript. Open source, even. Actual machine code gets generated. So performance isn't that bad any more. Javascript's object model, which is borrowed from Self, is rather clunky. On the other hand, variable declaration and scope is better than in Python. Javascript could use Python-like tuples. But it's close enough that, in a future rev, it could catch up with Python.
While developing an Ajax application called Grand Strategy, an implementation of the board game Risk, I have found one of my main gripes with Javascript to be the download times involved with using large amounts of it. There are things that you can do to mitigate: gzip compression, displaying progress bars, use short variable and function names, and then caching. There are ways to do dynamic downloading of portions of a library; you can see these in Dojo. However, these dictate that you radically structure your code to support it.
It would be very nice if the whole browser based development environment had mechanisms to deal with the dynamic loading of javascript.
Next we come to the next major javascript issue: the unreliable browser cache. Users of my game will occasionally not be able to log in, or a portion of the game becomes unusable, even after having played the game for weeks on end. Inevitably, some javascript in their browser's cache will have become corrupted, or seemingly partially downloaded.
Wow, that's too bad. Hopefully those other languages can have the police help them get the features back. Or maybe these languages can get replacement features from their insurance company while they wait for the trial? I know that I won't use those other languages until Javascript gives them those features back, so this is truly a tragic day for all those other languages. I speak from personal experience here, when a language steals features from you, you really feel violated and vulnerable. You want to lash out and kill those other languages. Cool heads should prevail though: with proper rehabilitation, Javascript can be made to stop its theiving ways and become an upstanding, productive member of the language society.
XML causes global warming.
all you ajax people out there thinking this is cool are a bunch of retards. The fact is that this "technology" is just hacked together crap.
I repeat myself again. Javascript and the entire web development stack is seriously broken. Just look at how long it takes to put together a decent, functional website and you will understand. The interaction between all of the components is seriously chaotic at best. The whole OOP in magical web land is more of an OOPS
Title says it all. A toy programming language used to create a bloody crapplet. That is a crappy, buggy application. All java is good for is as one poster so beautifully stated: quick and dirty prototypes, my emphasis on quick and dirty.
I'm tired of having to download a 150Mb set of libraries, and having to set some bloddy CLASSPATH environment variable. Code should just damn statically link, or have it's libraries in common places. (I'm looking @ you TomCat).
Now I know not many of these points apply to JavaScript, the braindead, hacked-up cousin, suitable for script kiddies testing their mad skillz.
1) HTML
2) CSS
3) JavaScript
JavaScript makes a good^W decent server side language as well. Sure, it's not the greatest language available, but on the other hand it's nice be able to use all of the same libraries/conventions on the server side as you do on the client side, which for some applications may outweigh the benefits of using an otherwise superior language.
As for XML (and the various associated schemas), yuck. I suppose if you were a masochist you would do it that way. Personally, the only time I ever deal with XML is when a client explicitly requests an XML web service. Otherwise I just use JavaScript (a.k.a. JSON) as the transport language as well. Really, though, it doesn't matter one bit what your transport is. All you have to do is write serialize/deserialize functions for both the client and server that agree on a common format, whether it be JSON, XML, or brainf*ck. Beyond that, you never have to look at it again.
And finally, others have pointed this out as well, but I just want to say it again:
You have two separate sentences here, and they have nothing at all to do with each other. (Unless by security you are referring to preventing people from stealing and reusing your JavaScript code and not security of the application code, but that's a completely different animal.)
If I don't put anything here, will anyone recognize me anymore?
In the context of this article, which clearly discusses how JavaScript can provide denser code than Java, and compares JavaScript with Java for applications "more commonly associated with Java," his response makes perfect sense.
And just a comment on the "all applets are Java" remark higher in the thread. Really? I was writing applets for PCs, sans any intent for web use, years before Java even existed. I think what we may have here is a terminology generation gap.
And you get a half-dozen responses showing the proper way to accomplish that, completely ignoring the fact that it was in fact a joke.
Programmer: an ingenious device that converts caffeine into code.
I have one word for all of you: "prototype.js" ( http://prototype.conio.net/ ). The day I discovered prototype.js I stopped hating javascript. It also made me appretiate the really cool ways javascript lets you do inheritance etc + reading the prototype.js code really gets you learning.
If you also use Firebug (make sure you get the latest beta) for debugging then programming web and javascript becomes fun!
With prototype.js the javascript code becomes probably 30-70% smaller. No self respecting javascript programmer should be without prototype.js. It rocks!
Namespaces will be present in ECMAScript 4, along with lots of other goodies.
n amespaces.html
You can track the ECMAScript 4 standards proposals here: http://developer.mozilla.org/es4/
And Namespaces specifically: http://developer.mozilla.org/es4/spec/chapter_12_
You can try out namespaces right now in ActionScript 3, which was modeled after earlier (incomplete) ECMA4 proposals.
Xerox is developing entire interactive websites consisting entirely of Javascript and my company has been unlucky enough to have to use one of them to access our book cover PDF proofs for approval on a printer's web site. I'm sure they had good intentions, but man, it's such a royal pain in the ass to use. I'm sure they think it's making our job easier, but I for one don't like it. Just let me click a link to download the proof and check a box to send an automated approval email. Waiting for pages to load because they are so unwieldy is not my idea of a good time, or efficient use of my good time either.
Terrible karma and aiming lower, which in this environment of one-sided reason, is higher.
...solely on JScript. 800K of JScript, to be exact. It's not as fast as C, and it's not as fun as Perl, but you get a free rendering engine, free networking engine, and free interface engine out of it. So now, new business applications can be built, from scratch, within a few days: copmletely custom for the client -- layout, navigation, business logic, features, functionality, and security.
But hey, when it comes to JScript, I've found some pretty obscure language bugs.
You definitely can hide instance variables in JavaScript. You have to employ JS's lexical closures, and it might seem a little odd to someone who's not used to it, but such as it is:
(Note: Give me a break, Slashdot! Why no "pre" formatting in code blocks???)
As for classes, it should be noted that JavaScript is prototype-based, which is really a very nice way of approaching OO once you get used to it. There is something of an effort to make ECMAScript more class-based, though, and the next version of JavaScript from the Mozilla guys will include support for classes.
Continuations are not supported as such, but Mozilla's JS 1.7 does include support for generators, which are very nice and can be used to do some of the things you could do with continuations.
The problem with developing Javascript code is that you are shooting at a moving target.
Unless the use is restricted to a highly controlled intranet setting it will be executed on an indeterminate set of runtime environments. Different browser vendors, different versions, different sub-builds... where does the madness end?
Unless you are doing something trivial you can wind up with several times the code necessary to get the job done on any one Javascript runtime. And bug testing? Well that takes far longer than it should for exactly the same reason.
I don't have a problem with the language itself. Or any one interpretation of the language to be more precise. But give me some solid footing.
Beef #2 - is your Javascript accessible to disabled users? Standard response: "F*** the disabled; they're a minority and we all know minorities deserve to be shot and pissed on." As I lack the Satanic vitriol necessary to punish people for unfortunate circumstances I find myself at odds with the Web 2.0 community.
This is the first post so far providing the real reasons why JavaScript sucks to program. JavaScript, while (potentially) useful in other environments, is almost always utilized in the web browser environment. In this area, JavaScript is a hack to try to make web pages function like an app. It's a nasty language (or at least I prefer something strongly typed and readable), hard to debug, unit test, and browser implementations vary (probably the worst part). I stay away from JavaScript at all costs, yet I have to use it all the time.
If you think JS is slow, you haven't tested Opera's implementation.
Hell no Javascript doesn't deserve more respect. Unlike, say Java applets, there's no security sandbox so rogue Javascript code can connect to the network and leak information from the client system.
Actually, the minimum is 2. (for dynamic content or user interaction)
:)
1) HTML
2) some programming language
Or you could do with just HTML, eg. writing an adventure game with only HTML isn't that difficult
(I still sometimes have to write some webapps for Netscape 3.x *sigh*)
- Raynet --> .
If there's anything wrong with JavaScript, it's the speed of execution. As far as I know, we still don't have a decent bytecode engine for it, making it at least as slow as Ruby.
Combined with HTML/CSS, it's worse. But actually, XHTML/CSS is the best we've got. Don't get me wrong, I wish we had something better...
And we do have something for rounded corners, drop shadows, and the like. It's called SVG. But I'm not convinced SVG is really any better than XHTML/CSS with transparent PNGs. (Yes, I know what vector graphics is, I'm talking about confusing standards/implementations.)
Don't thank God, thank a doctor!
I like the fact that JavaScript can be easily integrated with .Net applications. You can practically open a JavaScript interface
for your .Net application for free. The only thing you have to
do is attaching some application specifical objects.
Unfortunately, I have heard that Microsoft will replace JavaScript
engine in .Net with their proprietary scripting language. I hope they
will not let this happen.
JavaScript is not only useful as embedded language in browsers,
it is also very useful as a general purpose language as a
clean replacement for other scripting language (e.g. those
with syntax like $#&{ref}->* etc.).
Er Galvão Abbott - IT Consultant and Developer
JavaScript has lots of respect. It has allways been a very modern scripting language, even back in the day when Perl was the only free thing running on the server side and others where still building webapps in VB4 and flash was little more than an extended gif animator or something. ... Now that Java is fully open sourced I'm not holding my breath anyway. Could be that Java finally takes on in the RIA ballpark and causes Flash and Co. some real heat. Would make things interesting again.
It's the browser DOM frustration that puts people of and takes the wind out of JavaScripts big multi-plattform asset. It allways has. If for once the browserbuilders could get that in line JS would be adopted instantly everywhere. Until that happens we'll have the festering broswerwars constantly breaking JS consitency and pushing off people to Flash/AS, Java and whatever other plugin stuff people decide to toy with. Ajax hasn't changed that. Building neat stuff with JS (aka "Ajax") has allways sucked - even back in the nineties - and will continue to suck for quite some time. Growing JS ("Ajax") Frameworks that try to tackle incompatabilites with sheer truckloads of code only work as far as the JS engines don't buckle under the load. Open a few tabs and start a egroupware or some Google RIA app in another one to see what I mean.
Unless we finally get some OSS RIA capable plugin (XULRunner, Gnash or whatever) JavaScript won't be able to show it's full potential. I don't see MS teaming up with Mozilla to build a unified JS engine anytime soon.
We suffer more in our imagination than in reality. - Seneca
Realizing is half of the solution, and I agree fully with all your remarks.
The solution is within reach. Try echo2 (java) or Wt (c++) and you will find what you seek: one language that is clever enough to make abstraction of all the web idiocracies tolet you create web applications like any other GUI application (with a little more effort to have proper client-side event handling if you care about latency -- like stateless slot implementations in Wt).
Wrong rationale, wrong attacker, but their conclusion is right - POST is more secure than GET. Consider sites that put a session ID as a query string parameter, and consider a user pasting a URL into a message board. Nothing sensitive should ever be in the URL.
Of course, from their flawed rationale, I'm sure they're doing something else horribly wrong. If the user seeing the parameter is a problem, then maybe they should be sending it to him...
Javascript is like Basic - they both do the job in a quick and dirty way, and both encourage bad programming practices.
POST is more secure than GET, but not for that reason. The reason is because POSTed data does not get logged. Imagine a perfectly secure website that accepted credit card numbers. If those numbers were recorded on the server side as "GET /form?card=4111111111111111&exp=0909&cvv=211", then all of that security can be defeated by anyone who can access a logfile.
This is similar to "cookieless session" capability of PHP, to inject "PHPSESSID=092348sdf0923ksjdk" or whatever into forms and hyperlinks, so that GET parameter would save a session. It's bad because it puts sensitive data in the URI.
Yes, I know you can configure servers to log POST data, but it's generally a bad practice (because of the privacy concern) and certainly is not on by default on any web servers I've seen.
Comment removed based on user account deletion
It's essentially a Microsoft mechanism to make Internet IE-only. It has no other valid purpose and no-one should use it for anything. Ever.
It should be buried into deepest pit in Hell and anybody who invented it with it.
Yes, it's tragic. After JavaScript stole C's syntax, all my CPP macros stopped working. And Lisp has been an extremely weak and difficult language to use, ever since JavaScript stole its closures. But at least Lisp still has its macros and parens left.
-Don
Take a look and feel free: http://www.PieMenu.com
....JavaScript has only one error message: "Invalid Object". No matter what error you or anybody makes, it is always this.
Table-ized A.I.
If you come from a standards point of view, call it ECMAScript. That's the language's official name; JavaScript is the name of Netscape/Sun's implementation and JScript is the name of Microsoft's.
If you come from a historical point of view, call it JavaScript because that is the original language created by Sun and Netscape; they later submitted a subset of the lanugage to ECMA to create the ECMAScript standard, and Microsoft embraced and extended JavaScript to create JScript.
Your count is a little off on the languages. First off, HTML, CSS, and XML are not programming languages, they are markup languages (that's what the M in HTML and XML stands for). Secondly, HTML is a subset of XML (or at least XHTML is), so really XML/HTML should be expressed as XHTML, however as previously mentioned these arn't programming languages, so they can't be lumped into the same category as ECMAScript (or JScript/JavaScript is you prefer). The breakout of XHTML, CSS, and ECMAScript is actually just right, as this lends itself perfectly to a MVC model, in which the XHTML is your model, CSS is your view, and ECMAScript is the controller. Now, this is of course all on the client side, when you go to the server side there's another issue, but this is a advantage not a problem. If you wish to use only ECMAScript for development, that is of course perfectly possible, all you need to do is install one of the ECMAScript based application frameworks such as Cocoon (which admitedly also uses XSLT, but for most things the default XSLT files should suffice). So to summarize you really need to know 2 markup languages, and 1 programming language in order to write a web-based application, plus the associated APIs for any libraries or environments you wish to write in. You need to know, XML, CSS, and ECMAScript, with the XHTML and DOM APIs as well as the IE and W3C APIs. On the server side you have a ton of possibilities, and the choice is really more of personal preference. In my case, I'm a Java developer, so I tend to lean towards Java. However even in that I don't do pure Java as I usually use the Spring framework, so I also need to use XML for my dependency injection, and the property file format for my configuration constants.
Curiosity was framed, Ignorance killed the cat.
Here're some really good links about JavaScript:
http://www.crockford.com/javascript/
http://javascript.crockford.com/javascript.html
Clubbing server-side Java and client-side JavaScript is also something interesting:
http://getahead.ltd.uk/dwr/