|
|
loop not needed
If part of the point of this hint is to learn Javascript, then let's make it good Javascript.
I see no point in having the loop around the line that determines a random number.
I.e. the lines: for (loopcount = 0; loopcount should be replaced by the one line:var number = (Math.floor(Math.random() * 11));
screwup
The Geeklog comment submission code is screwing up again. My comment looked correct in the preview.
Comments...
Use HTML mode and the [code] [/code] tags (yes, *square* brackets), and Geeklog will leave everything alone. It sucks, but so far, nobody has managed to fully correct the HTML parser in Geeklog, and the [code] hack is a successful workaround. I'd fix it myself except I have no clue at all about dealing with RegEx...
code tags
Ah - square brackets!?!
code tags
What, you mean you don't see that nice note above each comment box? :)
much better
Wow - thanks Rob.
much better
I thought about making it blink, too :).
You're corrrect
Yep, sorry. When I was writing the code, I was also trying to figure out how to generate a random number. I tried doing this with the loop (which is useless in the code that stands) and forgot to remove it. Whoops. Good call.
More extensible version
This is even more extensible:
More extensible version
Or make a bookmark out of it and put it on the bookmark bar. Everytime you click it, you get a random page:
Here's a Bookmarklet
Drag this link named random to your Safari bookmarks bar!
I shortened the script and added a couple more links. Darryl ---
Here's a Bookmarklet
...which is how I found out that I can only paste 1000 or so characters as an HTML link in the comment box before the link doesn't work! So even though the link was valid, an excessive number of characters caused Geeklog to not render it as a link. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.10 seconds |
|