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
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 ";
Original: http://use.perl.org/~domm/journal/24038
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?
var staat = document.seas.staat;
var land = staat.options[staat.selectedIndex].value