Javascript hacker challenge

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply

What do you think?

Good idea - pragmatic test
1
50%
Bad idea - I dunno why
1
50%
Watch me knock this outta the park
0
No votes
 
Total votes: 2

alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Javascript hacker challenge

Post by alex.barylski »

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:

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)
}
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 :P

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?) :P

Ready.Set.Go!!! :)

Cheers :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Leave our name out of this in its entirety.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Um...
1) The DOM is *not* ready or available when inline script executes...and it MUST execute inline.
How do I mess about with the DOM, if it's not ready to be manipulated...

/me crys impossible...
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

feyd wrote:Leave our name out of this in its entirety.
Ouch...it was meant as more of a joke than anything...

But just out of curiousity...how does a contest become formal? Does it need the approval of the community?

I can't say I'm pleased with your tone or lack of any kind of expression, other than "I am tiger hear me roar" style of letting me know whose boss.

Do me a favour...next time...just drop the thread completely, I'll get the hint... ;)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

nickvd wrote:Um...
1) The DOM is *not* ready or available when inline script executes...and it MUST execute inline.
How do I mess about with the DOM, if it's not ready to be manipulated...

/me crys impossible...
I assure your it's not impossible... ;)

No one seems very interested in participating...so if your curious, email me and i'll show how I did it ;)

nuweb1@hotmail.com
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

But just out of curiousity...how does a contest become formal? Does it need the approval of the community?
Official contests are either run by or approved by the board of moderators. If there's a wide interest for particular contest expressed by the community, it certainly will be approved. Your proposal does not seem to be the case though.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

^^^ Clearly :P

I wonder why... *scratches chin*

There is, as a result of solving this problemm quite a handy feature which becomes available, not otherwise supported by javascript.

Meh...whatever...no biggie :)

Cheers
Post Reply