Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

domm (4030)

domm
  (email not shown publicly)
http://domm.plix.at/

Just in case you like to know, I'm currently full-time father of 2 kids, half-time Perl hacker, sort-of DJ, bicyclist, no longer dreadlocked and 33 years old

I'm also head of Vienna.pm [pm.org], maintainer of the CPANTS [perl.org] project, member of the TPF Grants Commitee [perlfoundation.org] and the YAPC Europe Foundation [yapceurope.org].

I've got stuff on CPAN [cpan.org], held various talks [domm.plix.at] and organised YAPC::Europe 2007 in Vienna [yapceurope.org].

Journal of domm (4030)

Wednesday April 06, 2005
05:24 AM

openguides; javascript

[ #24038 ]

This morning after boxing I met with Maks to solve an annyoing bug in vienna.openguides.org. The problem was that German Umlaute where mangled (sometimes). With some help from Kake we at least knew where to start looking, and after copious use of

print STDERR "..."

we tracked the problem down to a call to HTML::Parser.

After some looking at manpages etc I updated to the newest version of HTML::Parser and ... problem solved! Yay!

Oh, and yesterday I had to face the horros of JavaScript. One project needed some form fields prefilled depending on a value selected in a select box. After figureing out the JS code necessary (

var land=document.seas.staat.options[document.seas.staat.selectedIndex].value;

, ouch) I worte a small script that generated the 50 lines of JS code necessary to have an pseudo associatve array. 50 lines of boring

Vorwahl["AT"]="+43 ";

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • All arrays in Javascript are associative. In fact, every object is an array and every array is an object. Methods are just array elements.

    foo.bar and foo["bar"] are the same thing. foo.0 or foo[0] is also the same thing, if bar is foo's first element.

    Consider: vorwahl = { NL: "+31", BE: "+32", US: "+1", ... };
    • var current = document.seas.staat.selectedIndex;
      var select  = document.seas.staat.options;
      var land    = select[current].value;

      Surely this a a lot more simple that having some external way of doing things?

      --
      -Scott McWhirter- | -kungfuftr-
      "JAWK - Just Another Whiny Kid"