JavaScript中解析URL

通过正则表达式来处理URL function parseUrl(href) { var match = href.match(/^(https?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)(\/[^?#]*)(\?[^#]*|)(#.*|)$/), query = null, keyValue […]