query.js 332 B

1234567891011121314
  1. /**
  2. * 获得URL中的参数
  3. * @param variable
  4. * @returns {string|boolean}
  5. */
  6. function getParam(variable) {
  7. var query = window.location.search.substring(1);
  8. var vars = query.split("&");
  9. for (var i=0;i<vars.length;i++) {
  10. var pair = vars[i].split("=");
  11. if(pair[0] == variable){return pair[1];}
  12. }
  13. return(false);
  14. }