User talk:Mike Dillon/Scripts/params.js

Currently this script does nothing to remove the URI's fragment if it has one. I'd recommend doing that right before checking the memo cache:

(That's not how I'd think to remove the fragment, but it's the most consistent with your scheme for extracting the query.)

Incidentally, the whole assign-to-a-closure technique for creating a function with a static local variable? Brilliant! I'm totally going to start using that myself.

—Ruakh TALK 18:12, 22 February 2008 (UTC)


 * I think another way to do that is to use window.location.pathname instead. I'd have to verify the cross-browser compatibility though. Mike Dillon 19:01, 22 February 2008 (UTC)


 * It might also make sense to make getParameterValue take the last value instead of the zero-th value. I think I modelled this after Java's HttpServletRequest methods originally. Mike Dillon 19:03, 22 February 2008 (UTC)


 * From Googling, I get the impression that window.location.pathname is just the hierarchical part (so, excluding the query); however, window.location.search is apparently the query plus leading '?'. I've tested this in Firefox 2 and IE 7, and it works in both; if it works more generally, then I think that's the thing to use. —Ruakh TALK 19:50, 22 February 2008 (UTC)


 * Yeah. My comment was kind of dumb. Mike Dillon 19:54, 22 February 2008 (UTC)


 * http://developer.mozilla.org/en/docs/DOM:window.location#Properties describes window.location.search as non-standard DOM level 0, which I think means it has good browser support. I'm going to change MediaWiki:Preloadtitle.js to use it. —Ruakh TALK 19:57, 22 February 2008 (UTC)