views:

73

answers:

1

It seems like cookies and querystrings are firmly established in the web world. Nevertheless, javascript makes you do all kinds of splits and parsing to get at the keys and values. Anyone have any insight on why there isn't more intuitive native support for things like cookies and querystrings?

Admittedly, there are plugins and frameworks that make this stuff a little better. I just want to understand why there had to be plugins and frameworks to handle basic stuff like that in the first place.

+4  A: 

That's not a problem with javascript - it's a problem with the DOM. Unfortunately the DOM API has many problems - Browser makers aren't perfect.

There really should be better support for this though. The W3C including it as a standard in the HTML spec would be a good start.

Mike Blandford
+1 DOM/browser problem, not a language problem
Bryan Matthews
Granted, but JavaScript exists to do things that the DOM by itself cannot do. My point is that these two basic collections ought to have been handled more intuitively by JavaScript ages ago.
Byron Sommardahl
Javascript itself is just a language. There are server implementations of javascript, and there is an Adobe Acrobat implementation of javascript. (You can run javascript in a pdf document). In either of these contexts cookies do not make sense. Cookies and Querystring are something that the DOM in fact can and should do better. (The DOM should provide functions to manipulate these objects, and javascript should just call these functions).
Mike Blandford
@BryanM or more accurately DOM/browser/browser .js parser problem. (i.e. IE)
Talvi Watia