While working with a simple algorithm I've had the incredible idea of using indexOf to check if a string value is found in an Array. You can imagine my face when I realized that IE(6,7,8) doesn't support Array.indexOf (it does for String, however). You can find a decent workaround here : http://soledadpenades.com/2007/05/17/arrayindexof-in-internet-explorer/ or of course, use a JS framework.
After I fixed the Array problem for IE I actually got to a very basic task. Get the value of a cookie. First of all I don't see why there isn't a built-in way to manage cookies, something like document.setCookie, document.getCookie, etc. It's dumb to do searches in the string and splitting, and stuff like that. I also hated the fact that you can't read the expiration date of a cookie, but you can write it anytime. That doesn't make very much sense to me.
As if the cookie stuff wasn't enough, I got to the point where I had to get some parameter values from the query string and again, there's nothing built-in to get these values. You actually have to parse the whole string and then search in the resulting bits.
At the end of the day I can clearly say that all these problems are solved by using a JS framework and this makes a good case for using one, but what do you do if for whatever reasons you can't use frameworks ?!
The most important product for any product manager
11 months ago