Apr 18 2008

Innovative way of using maps in a news setting

Tag: Rant, Web development, still interestingchristoph @ 2:33 pm

Cracked road

It’s springtime in Norway now a days, and when the snow melts away you may see what the frost and cold does to the tarmac during the winter. The roads usually take quite a beating during the winter, and in the springtime they are in pretty bad shape. It’s the same every year and the newspapers write quite a lot about the subject. The local officials are trying their best (naïve assumption) to fix holes however they usually spend some time finding all the holes.

One year ago one of our newspapers, Drammens Tidende tried an experiment with letting their readers email them about the cracks and holes and they put it all up in an “action map” that they use to show the readers where things are going on. This year, Fredrikstad Blad has tried the same, and this is the first time I’ve heard about it.
I think it’s a pretty innovative and interesting way to interact with the readers, even if the readers has to send in emails to report of holes. Nonetheless the reports I have gotten tells me that it has received quite and amount of response and that is a very good thing.

Read about it here in this article, and see the map here.

.

Photo credits: SXC.hu

Continue reading “Innovative way of using maps in a news setting”


Oct 26 2007

Elements.getTotalSize(), get the total size of an array of elements

Tag: Javascript, Mootools, Web developmentJens @ 8:12 am

While creating a mootools Slider-controled image gallery navigator (fancy huh?) at work, I suddenly had the need for getting the Total size (width in this case) of all the li elements inside a ul.

Continue reading “Elements.getTotalSize(), get the total size of an array of elements”


Sep 07 2007

Json.test() for mootools

Tag: Javascript, Mootools, Web developmentJens @ 11:25 am

I wrote a small extension to the Json class in mootools, to check if a string is valid Json format.
Continue reading “Json.test() for mootools”


Sep 05 2007

$get() for mootools, reading get variables

Tag: Javascript, Mootools, Web developmentJens @ 6:21 pm

In a project at work we had the need for tampering with href’s and other url’s with JavaScript.
And beeing a mootools fanatic, I chose mootools as the framework to build my sollution on.

My general idea was to create a generic function to read the get variables from any given url, with the current location.href as default. And also be able to return the element anchor if set. This would come in handy if we ever needed to rewrite url’s before opening them with ajax or in an iframe, and to read get variables in javascript.
Continue reading “$get() for mootools, reading get variables”


Sep 05 2007

Empty src attribute on <img> is the devil!

Tag: (X)HTML, Web developmentJens @ 5:57 pm

.. at least when combined with Firefox.

To make a short story long, here’s the full story :p
The last few days at work has been a battle of the rare and unpredictable.
A weird bug in our latest project made my team go crazy (you know, the BAD kind of crazy),
and it was a Firefox only bug. oO

It started off when our “report this” feature returned double reports, one with the POST based (non-required) input, and then another one with only the GET variables (id, required value).

This got us all fuzzed and put our brains to the test. Loading our favourite Web debugger tool (firebug anyone?), we saw that Firefox added another GET request for each and every page on our site. That was odd, very odd.

Searching for an answear, we started checking all the pages, each and every one, and it appeared that the double requests happened on all pages, but only when the user was logged in.
So naturaly, we started looking at the login process. Session management anyone?

And if you read the title right, the session road was a dead end road.. a long and tidious dead end road that is..

And after a few hours with firebug, http header monitor, calling the hosting company, and all that fuzz… I updated our user-navigation menu, adding an icon where the src attribute was empty, and guess what.. Suddenly, NO MORE DOUBLE GET REQUESTS!

So that was it, an empty src=”" made calls back to the same page (much like a missing action attribute for forms or empty action=”" loads the same page on submit).

[ratings]


May 25 2007

IE7, position absolute and background/event transparency

Tag: (X)HTML, CSS, Design, Javascript, Web developmentJens @ 9:49 am

At work today I was striving with IE7 and absolute positioning.
It seems like IE7 has a default of “background: transparent;”, and takes it a bit more literaly than we’re used to..

So if you set an element to cover another with absolute positioning, all events (onmouseover, onmouseout, onclick, etc) is passed on to the underlaying element. That is, unless the overlaying element got a background other than “transparent”.
A color value, image, or transparent png with at least 1% opacity works, but it has to have SOME opacity.

It is not the first time I’ve run into this problem, and I’ve always solved it by adding a semi-transparent png with 1% opacity of either white or black. But this seems like a dumb hack, having to add more images and so on.

But today I discovered that setting an non-image value for the image url() (like url(undefined)) as background works the same way as adding a background-color or a png with opacity 1%, and thus removing the transparency from the element.

The url() cannot be empty, it has to have SOME value, like “undefined”, “test”, “foo”, or whatever suits your needs:


/* This will work */
#foo {background: url(bar);}

/* This won't */
#bar {background: url();}

So there you go, now the element has a transparent background, while not passing the events through to the underlaying element :)
[ratings]


May 07 2007

moo.chat 0.1b!

Tag: CFML, Javascript, Web developmentJens @ 3:45 pm

So I was playing with moo.fx (now mootools) some time ago (6 months or so).
And came up with moo.chat, a lightweight chat application buildt on moo.fx, CFML and MySQL.

It’s still in it’s early beta/alpha stage, but if anyone wants to check it out, please be my guest!

[ratings]





Warning: stristr() [function.stristr]: Empty delimiter in /home/asocialp/public_html/wp-content/plugins/wassup/wassup.php on line 2093