Board Thread:General Wiki Discussion/@comment-25230922-20150704031010/@comment-25428589-20150704165834

MrDupin wrote: No no, it does go to a random page as intended. But because the link reads "Writer's Showcase" one might think that it goes to the Showcase (and not in a random page). Ah right, yeah. I was actually planning on changing that when/if SoPre gave me admin on his test wiki, lol.

My knowledge of web development is a bit rusty, so care to explain this a bit to me? From what I understand, clicking on the link "sends" the user to a special page that in turn redirects the user to a random link.

So, in that special page, the code finds via a method a random page, right? Can't this be done without the middle step (going to the special page)?

If we were to do that calculation in the main page it would speed things up significantly. Then, instead of linking to the special page, we could link directly to the random page. The purpose of the special page isn't just to pick a random page, it is what gets the list of threads. It does this by loading an external page (the board page for whatever category's being targeted). This couldn't be done in the template itself, especially if said template was going on the home page, since we're loading two pages in one, we'd effectively be doubling load times on the home page (very bad for the end user).

Hehe, that syntax reminded me why I hate web programming so much...

Anyway, thanks for the code. I have one thing I need clarified though:

window.location.replace("/wiki/Thread:" + thread);

I believe that this is the line that redirects to the random thread, right? Yeah.