git-svn-id: http://xe-core.googlecode.com/svn/trunk@988 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-04-06 03:48:39 +00:00
parent aeb1d32bf2
commit 7b5e44ea20
14 changed files with 368 additions and 25 deletions

View file

@ -9,13 +9,14 @@
**/
String.prototype.getQuery = function(key) {
var idx = this.indexOf('?');
if(idx == -1) return;
if(idx == -1) return null;
var query_string = this.substr(idx+1, this.length);
var args = {}
query_string.replace(/([^=]+)=([^&]*)(&|$)/g, function() { args[arguments[1]] = arguments[2]; });
var q = args[key];
if(typeof(q)=="undefined") q = "";
return q;
}