Siebe 的个人资料Siebe Tolsma日志列表留言簿 工具 帮助

Dangit, trackback spam!

Probably the most annoying thing about trackbacks is trackback spam. I recently enabled trackbacks for all sites on this blog to see how it would go. And whadyouknow, within a week I had like over 100 new trackbacks from all over the place -- And most of them spam. So for now I have disabled trackbacks again (okay, that isn't entirely true, people from Windows Live Spaces can still trackback my blog).
 
I wish there was a better way to protect against spam like that. Perhaps a first step would be that trackback URL has to be unique. I noticed several trackbacks had exactly the same URLs, which is pointless of course. Second there has to be some kind of way to identify real blogs. But for that we would need cooperation with a lot of different sites, such as Blogspot, Myspace, MSDN blogs etc etc.. Preferably some open standard everyone can use.
 
Oh, here's an idea, why not just let us Spacers add URLs we know are safe. So I can pick which major blog sites can trackback my blog posts. And here's another idea, Spaces should offer a predefined list of blog sites that are considered safe in general. That way every user can add all those predefined sites in one click of a button, and then filter out or add any sites they don't like.
 
It would only take a database table, a couple of regular expressions and some UI work. Wouldn't be too hard, would it?

More on InnerHTML and IE

As I blogged before, when changing the InnerHTML property of a DOM element in any way in IE (for as far as I am aware this applies to any version of IE), you will loose the attached events. To correct a small mistake I made in my previous post, you need to attach the event using AttachEvent(). Applying an event using the traditional onsomething="" will still work.
 
So today I found another problem with InnerHTML -- When changing it in any way, you will also loose any custom attributes on any of the children of the element you are appending to. I figured this out after a painful debugging session of over 2 hours (the fact that I was changing InnerHTML which might cause the problem didn't even occur to me at all at first!). Note that, as with the events, any regular attributes attached using attribute="something" might still work, as I have only tested the cases where I was using SetAttribute and SetAttributeNode.
 
I am also still amazed I cannot find any information about this on the web. Has no one ever encountered this problem before?

Stop consuming products containing Aspartame

If you regulary drink or eat products that contain the artificial sweetner aspartame, then do the right thing, and stop consuming those products and replace them with alternitives that do not contain aspartame. The chemical compound contains very nasty stuff, including a chemical called Methyl Ester, which when digested and broken down in the digestive system will transform into Methanol which is a poisenous form of alcohol.
 
Aspartame has been linked to a large range of symptoms, most of which are related to the functioning of the brain, often because aspartame affects the production and/or effectiveness of neurotransmitters. Ever since aspartame was introduced in the 80's for general consumption diseases related to the brain (such as brain tumors, eleptic seizures) and other conditions such as multiple sclerosis and fibromyalgia, diabetes, etc. have rissen dramatically.
 
People who digest large amounts of aspartame often comlain about headaches, stomach pains, not being able to focus and/or concentrate, feeling like their head is filled with nothing/air. Aspartame can also cause rashes, nausea and vomitting when first digested. When digested over a longer period of time you will be effectively poisoning your body.
 
 
I know I will from now on look way more carefully at what I am eating and drinking, especially for artificial sweetners like aspartame. Nevermind all those diet products -- If you look at the general American population you will see even though aspartame was introduced over 20 years ago, obesity is at an all time high. Regular sugar is still healthier, but like anything, use with care, and don't eat too much of it.

Small movie weekend

Having a long weekend off (Labor day!) last weekend I figured I'd get some movies to watch. So I did. First I got Underworld, which I've never seen before except for a couple of minutes when it was on TV. Very cool movie. Then I got Underworld Evolution, the sequal to Underworld. Also a cool movie, although the final part of the movie was a bit weak.
 
After that I got Lucky Number Slevin, which was a really funny movie -- And mind boggling! It's sort of like Oceans Eleven, where you are kept on the wrong track until the very end of the movie. I really enjoyed watching it, and I can seriously recommend it to anyone who liked Oceans Eleven.
 
Then I watched Hearts in Atlantis -- A drama-ish movie about a psychic guy (Anthony Hopkins) who moves in with this kid and his mother. It was actually a pretty good movie, but not the best ever.. Perhaps I was expecting too much from it. But if you have some time to kill, go watch it.
 
I also saw most of Enchanted Ella on TV. Weird movie. Then again, I suppose it's meant for kids and stuff ;-) It's one of those classic fairytales about some girl who gets some mean stepsisters and stepmom, then meats this prince who has a huge fanclub, etc etc. I guess it's kind of funny if you're in the "right" mood *rolls eyes*
 
I also got the 2-DVD of "Buurman en Buurman", an old animation TV serie for kids. It is known in various countries as Pat & Mat. It's basically about two neighbours who always have an optimistic look on things, and always get into trouble one way or another and then solve it together with the most impossible solutions. It's very very funny.
 
A je to! Until my next blog entry.

InnerHTML annoyance

Note: This seems to be an IE bug only. I've run into this problem before (back in the days we still had IE5.5) and the bug seems to persist. I've just recently run into again, and I figured I'd drop a little note on my blog warning you all.
 
Here goes: IE supports a property called InnerHTML. Basically it let's you set, clear or append raw HTML to the contents of a given DOM element. The InnerHTML property is not part of the DOM spec. However, all other browsers, including FireFox (or rather, the Mozilla engine) have also implemented the InnerHTML property, making it work cross-browser. Furthermore, it's faster, easier to use and maintain than using the DOM!
 
The bug I stumbled upon is this: when HTML is already present in the DOM element, and the ChildNodes of that DOM element have events attached to them (eg. onclick, onmouseouver, etc ..), appending HTML to the element will cause all events to be erased. This is a very annoying, and quite serious bug. Observe the following:
 
<div id="somediv">
    <a href="#" onclick="alert('hi!')">Click here!</a>
</div>
 
Now, let's append some HTML to that DIV:
 
var div = document.getElementById("somediv");
    div += "<br>This is some more text!";
 
Try clicking the link. Nothing happens. The event has effectively been cleared, however I am fairly sure that with more complex structures/code (such as heavy use of closures) this will cause heavy memory leaking. Again, this is an IE only bug. Firefox will keep the onclick event.
 
So be wary, very very wary when using InnerHTML.