Tag: JavaScript

  • Javascript’s Math.random() – when random isn’t random

    Yesterday I wrote a function in Javascript that should return random integers in a given range; basically just the same as the PHP function rand($min, $max). But after a few test runs I noticed that the numbers were not quite as random as they should be; some of them appeared more often than expected, others…

  • Open links in new window XHTML-conform

    When I wanted to convert my blog to XHTML (finally), I first started with the Transitional version. There was really only one reason for that: in XHTML Strict, the target attribute is not allowed. I don’t want to get involved in any discussions about whether or not a webmaster may infantilize the user by forcing new…

  • JavaScript and CDATA sections in WordPress posts

    In the context of the XHTML-conform embedding of Google Maps, I encountered two problems (again): When I tried to insert the JavaScript with the CDATA section, WordPress got under my feet with its usually so comfortable automatic formatting functions. The end marker /* ]]> */ suddenly became: /* ]]> */ A line in the file…

  • Embedding Google Maps XHTML conform

    I’m quite glad I can write this post, for it allows me to parenthetically intersperse the news that I did not deem worthy of an own post: I have spent the last three days making this site XHTML valid. First I had started with the Transitional version, because otherwise several things which I wanted to…