Sha256: 8a213c01f64afcef09a40b168bee0aa2d42bdfe44c06dea1a667b148c82cc57e

Contents?: true

Size: 796 Bytes

Versions: 41

Compression:

Stored size: 796 Bytes

Contents

function QSObject(querystring){
    //Create regular expression object to retrieve the qs part
    var qsReg = new RegExp("[?][^#]*","i");
    hRef = unescape(querystring);
    var qsMatch = hRef.match(qsReg);

    //removes the question mark from the url
    qsMatch = new String(qsMatch);
    qsMatch = qsMatch.substr(1, qsMatch.length -1);

    //split it up
    var rootArr = qsMatch.split("&");
    for(i=0;i<rootArr.length;i++){
        var tempArr = rootArr[i].split("=");
        if(tempArr.length ==2){
            tempArr[0] = unescape(tempArr[0]);
            tempArr[1] = unescape(tempArr[1]);

            this[tempArr[0]]= tempArr[1];
        }
    }
}

function queryParamFor(jsFile) {
  url = $('script[src~='+jsFile+']').attr('src').toLowerCase();
  return new QSObject(url);
}

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
wheels-0.1.8 public/javascripts/jqUrl.js
wheels-0.1.7 public/javascripts/jqUrl.js
wheels-0.1.6 public/javascripts/jqUrl.js
wheels-0.1.5 public/javascripts/jqUrl.js
wheels-0.1.4 public/javascripts/jqUrl.js
wheels-0.1.3 public/javascripts/jqUrl.js
wheels-0.1.2 public/javascripts/jqUrl.js
wheels-0.1.1 public/javascripts/jqUrl.js
wheels-0.1.0 public/javascripts/jqUrl.js
wheels-0.0.49 public/javascripts/jqUrl.js
wheels-0.0.48 public/javascripts/jqUrl.js
wheels-0.0.47 public/javascripts/jqUrl.js
wheels-0.0.46 public/javascripts/jqUrl.js
wheels-0.0.45 public/javascripts/jqUrl.js
wheels-0.0.44 public/javascripts/jqUrl.js
wheels-0.0.43 public/javascripts/jqUrl.js
wheels-0.0.42 public/javascripts/jqUrl.js
wheels-0.0.41 public/javascripts/jqUrl.js
wheels-0.0.40 public/javascripts/jqUrl.js
wheels-0.0.39 public/javascripts/jqUrl.js