Javascript hacker challenge
Posted: Sat Sep 09, 2006 2:40 am
Edit: To be fare...and prevent people from using your ideas...PM the result code and I will test each entry on Windows XP (IE6, FF1.5, NS8.1, OP9.01)
I will bump this thread in a day or two with the results and associated code for all to see and learn from...and results of my tests. Anyone capable of testing on Linux or a Mac would be awesome if you PM'ed me and offered your judging.
For the sake of brevity...cause I know your all just shooting to go...maybe a limit of the first 15-25 entries will be accepted...one per candidate...I'm already in so make that 24
===================================================
So here is the proposal:
Rules:
Using the *most* cross browser approach possible and as elegantly as possible, calling changeDOM() as inlined Javascript like shown above allow changeDOM to access to the DOM...
Points should be considered lost for each browser not supported...perhaps we can have series of people test on various browser(s) Apple, Linux and Windows and the one which is MOST cross browser wins...
Hints:
1) The DOM is *not* ready or available when inline script executes...and it MUST execute inline.
2) defer="defer" in script tags is not that cross-browser friendly
Ladies and gentlemen here we have a challenge which will can actually be quantified (using test browsers and results) so the winner is clear and obvious...no cheating or favourites...
I present to you (drum roll) The Unnofficial PHP Developers Network First Annual Coding Contest (Award?)
Ready.Set.Go!!!
Cheers
I will bump this thread in a day or two with the results and associated code for all to see and learn from...and results of my tests. Anyone capable of testing on Linux or a Mac would be awesome if you PM'ed me and offered your judging.
For the sake of brevity...cause I know your all just shooting to go...maybe a limit of the first 15-25 entries will be accepted...one per candidate...I'm already in so make that 24
===================================================
So here is the proposal:
Code: Select all
<html>
<script src="test.js"></script>
<script>
changeDOM("test1", "Bold section changed dynamically");
changeDOM("test2", "Anchor changed dynamically");
</script>
<body>
<b id="test1">Some static text - to be changed dynamically</b>
<a href="" id="test2">Some static hyperlink - to be changed dynamically</2>
</body>
</html>
Code: Select all
// test.js
function changeDOM(content)
{
// Manipulate the DOM (something easy like innerHtml, etc)
}
Using the *most* cross browser approach possible and as elegantly as possible, calling changeDOM() as inlined Javascript like shown above allow changeDOM to access to the DOM...
Points should be considered lost for each browser not supported...perhaps we can have series of people test on various browser(s) Apple, Linux and Windows and the one which is MOST cross browser wins...
Hints:
1) The DOM is *not* ready or available when inline script executes...and it MUST execute inline.
2) defer="defer" in script tags is not that cross-browser friendly
Ladies and gentlemen here we have a challenge which will can actually be quantified (using test browsers and results) so the winner is clear and obvious...no cheating or favourites...
I present to you (drum roll) The Unnofficial PHP Developers Network First Annual Coding Contest (Award?)
Ready.Set.Go!!!
Cheers