PDA

View Full Version : beetle please come here. question.


youngScripter
02-12-2003, 04:42 AM
I saw one of your posts that gave a link to your kooky scramble link script, and I looked at your script, and I was wondering why didn't you do it the shorter way? Here's my version of the scrambler:

<script language="JavaScript">
<!--

function scramble(x,w) {
document.getElementById(x).innerText = w;
}

// -->
</script>

then just use:

<a href="#" id="1" onMouseOver="scramble('1','word');" onMouseOut="scramble('1','dorw');">dorw</a>

I'm just wondering why you used the longer version of the script.
-youngScripter

youngScripter
02-12-2003, 05:19 AM
oh wow, I just realised that I'm on the Post a JavaScript board. oops, sorry mods! I didnt realise it! But beetle, could you please still answer my question?

beetle
02-12-2003, 06:47 AM
My script scrambles the links for you, and doesn't require that you add mouse events to EVERY link. Your's does the opposite on both accounts.

So in fact, on a page of 100 links, mine wouldn't need to change at all, just add the links. For yours, well, let's just say you'd have a lot of cut'n'paste and some word scrambling to do.

:D