Flutterby™! : Sweet JavaScript

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Sweet JavaScript

2005-12-13 21:00:36.751874+00 by meuon 13 comments

Just thought Matt Kruse deserves some link love for an excellent examples and source code of a pop-up Javascript data selector. Nice Stuff..

Yes, I am becoming a dark Lord of Javascript and Ajax...feel the force... cash the checks..

[ related topics: Web development ]

comments in ascending chronological order (reverse):

#Comment Re: made: 2005-12-13 21:06:12.293915+00 by: Dan Lyke

I think "feel the force... cash the checks" is going to become some sort of personal tag line.

Now, can you find a way to make that pop-up show up on the same screen as my browser?

#Comment Re: made: 2005-12-13 21:17:46.373362+00 by: meuon

Probably.. Using style sheets and replacing a div tags content like This Example does.

#Comment Re: Sweet JavaScript made: 2005-12-13 22:56:26.696166+00 by: Dori

Java != JavaScript

... as I've been grumbling about for many years now. I would dearly love to not have to.

#Comment Re: made: 2005-12-13 23:14:21.517331+00 by: meuon

Dori, Expand please. I assume you don't like 'Java' but like 'JavaScript', but fear that may be backwards.

#Comment Re: made: 2005-12-13 23:28:50.567441+00 by: Dan Lyke

I believe that Dori's complaint is over your title for the post, that it should be "Sweet JavaScript".

As much as I dislike JavaScript, it does have the occasional positive use (although I'd like to smack the folks at Dictionary.com and uComics for their gratuitous use of JavaScript that reduce the usability of their site).

Java, on the other hand, makes me want to... well... let's just say that I don't write code in the damned environment, I just try to run sofware written for it, and the only solace I have is knowing that once I get the environment configured such that the monstrosity will run, at least it will run at a glacial pace. There are things to be said for Scarab, but it's my belief that you could say a lot more nice things about it if it were written in Perl[Wiki] or some other language with actual performance.

#Comment Re: made: 2005-12-13 23:39:58.707604+00 by: ebradway

Since Firefox 1.5 came out, I've switched almost entirely from Netscape. But I have the NoScript plugin installed. It's absolutely astounding how many sites use javascript. It seems every page and every banner ad use JavaScript. Ugh!

And since Microsoft lost their patent battle, IE requires I click "OK" everytime I go to a site that uses ActiveX... Double UGH!

Javascript corrects some really glaring holes in HTML. Mainly, form validation. WWW tends to follow the old mainframe paradigm for edittable records: lock-read-unlock-fill-page...wait for input...wait...wait..lock-write-unlock, go on... It's long been know, BTW, that you can't lock the record through the entire edit sequence because the user might not return to unlock it (that is, close the browser). Input validation allows basic stuff like "don't put letters in a numeric field". Probably 90% of Javascript out there could be avoided if we had richer inputs in HTML...

#Comment Re: made: 2005-12-14 00:44:46.403593+00 by: Dori

Dan got it. Java and JavaScript are two entirely different beasts, and seeing the two confused is one of my pet peeves.

It's not an issue of liking one and disliking the other. I've written books on both, and if I never get another email about how my Java book sucks because it doesn't cover how to do image rollovers, that'll be soon enough for me.

#Comment Re: made: 2005-12-14 01:04:32.477531+00 by: Dan Lyke

Okay, I took an editor's prerogative and fixed the title...

Eric, one of my lessons on field validation came from the days when I went crazy with state machines. Remember the GROUPS filename entry box? 8.3 all the way down, backslashes in all the right places, it was a thing of beauty. I think I also considered doing something similar for phone numbers, because back then we knew that the second digit of an area code could only be a one or a zero, and the first digit could only be a...

Yeah, both of those rules went invalid well within the working life of the software. I'm now of the "if I have to do calculations with it I'll make sure it's a number, and I'll try pretty much everything I can to extract a date from whatever text you give me, but I don't validate anything I don't have to, everything is a text string" camp.

#Comment Re: made: 2005-12-14 01:17:51.199198+00 by: Dori

Oh great, now I just look like someone whining over a non-existent problem....


#Comment Re: made: 2005-12-14 15:29:07.224191+00 by: markd

Don't worry Dori - I saw the previous "Sweet Java" and was confused. I figured the OP just made a typo.

#Comment Re: made: 2005-12-14 15:48:29.467022+00 by: meuon

Yeah.. I did. My apologies, thanks for fixing the header.

I agree with Eric, the ONE thing I find missing from HTML Form tags is basic data validation. I've been munged some kewl Javascript together, and it's been almost all data input validation, and in a few places 'fixing' MSIE issues.

#Comment Re: made: 2005-12-14 16:00:26.399953+00 by: ebradway

Dan: Is there a Perl module that will extract things like dates or phone numbers from unknown fields? If not, there should be! I've done back-end validation, or rather, fuzzy data extraction, more often than not because people really don't like validated entry fields - unless they work exactly the same everywhere. I've been filling out grad school apps online and have spent alot of time scratching my head over date formats (dd/mm/yyyy or dd-mm-yy or ddmmyyyy or yyyyddmm) and phone number fields (aaapppnnnn or aaa-ppp-nnnn or (aaa)ppp-nnnn). Everyone wants something different and they aren't always clear up front. Why couldn't HTML have a INPUT TYPE="PHONE" or INPUT TYPE="DATE" and have the browser intelligently handle it based on your region code?!? And pass something consistent to the server?

#Comment Re: made: 2005-12-14 16:05:52.77739+00 by: Dan Lyke

See Date::Calc and Date::Manip. If it looks like a date either of those will figure it out.