Category Archives: JavaScript

Adding Flash Dynamically Using document.createElement Considered Harmful

I have come across an interesting bug in IE. In a web page I dynamically create 8 flash <embed> elements using document.createElement. If I stop using document.createElement. The bug goes away. If I clear the cache and load the web page, … Continue reading

Posted in JavaScript | Leave a comment

The Latest In The World Of JavaScript – "AJAX, Web 2.0 and the World Of Tomorrow"

This Is Not The JavaScript Our Parents Would Know In the bad old days JavaScript was not compatible across browsers. JavaScript development was painful, frustrating and costly. More recently JavaScript has become the poster-child for effective web programing and the … Continue reading

Posted in AJAX, JavaScript, XML | Leave a comment

Dynamic Generation Of Flash Elements that use FSCommand – JavaScript and VBScript do not work via innerHTML

I have a requirement to dynamically add flash elements into a page and have FSCommand function properly. FSCommand is the primary method that Flash gives a programmer to execute scripts within the parent browser. This requires some shim code to be added … Continue reading

Posted in JavaScript | 8 Comments

The Brain-Slurping Abomination Of The "onclick" Listener On An Anchor Added With "addEventListener" – Return Value Hell

If you add an onclick listener to an anchor with addEventListener, the return value is ignored and whatever is in the href is activated. I come across this issue every day and have written about it before, but its only … Continue reading

Posted in JavaScript, Rants | 1 Comment

To ' href="javascript:f()" ' or ' href="#" onclick="f()" ' – That is the question.

You see both of these methods being used so often that you have to wonder – which is correct? href=”javascript:f()” vs href=”#” onclick=”javascript:f()” The classic ill side-effect that can occur when using the javascript: within a href attribute is when … Continue reading

Posted in Downtime, JavaScript, Rants | 4 Comments

More On MetaWrap WireWrap

I’m experimenting with describing all my CSS and JavaScript behaviors in XML. Currently working on allowing the optional nesting of CSS selectors which results in rules generated with normalised versions. for example.. <selector css=”pre”> <style> font-size: 1.1em; background: #f0f0f0; -moz-border-radius: … Continue reading

Posted in JavaScript | Leave a comment

More Evil On Safari

Found an issue with Safari (tested against version 1.3.1) With the following code…. var l_a5 = document.getElementById(“a5”);l_a5.onclick = f1; l_a5.onclick = null; l_a5.addEventListener(“click”,f2,true); .. when clicking on the element referenced by l_a5 will result in both events triggering in the order … Continue reading

Posted in JavaScript | 1 Comment

Automatic Dependency Resolution For JavaScript Libraries

Just added a feature to my JavaScript libraries so that they can work out what other JavaScript libraries need to be included and then includes them in the correct order. Most of the work is done by the foloowing three … Continue reading

Posted in JavaScript | Leave a comment

Opera Bug 180474 – doh!

Just lodged my first bug for Opera, only to figure out 5 mins after I hit submit that its not a bug with Opera, Its a bug with every other browser. Seems that in Opera 8.5 when you use addEventListener with … Continue reading

Posted in JavaScript | 1 Comment

JavaScript Logging With FVLogger And The MetaWrap Logging Class

Adds cool logging widget to your pages. Something else I was thinking about building, but now someone has done it for me.. w00t – Looks great! http://alistapart.textdrive.com/articles/jslogging#fvlogger [Update] Decided to write my own after all. Needed some good logging for … Continue reading

Posted in Coolhunting, JavaScript | 1 Comment