lychee/src/scripts/_gup.js
2016-01-24 15:20:33 +01:00

12 lines
218 B
JavaScript

function gup(b) {
b = b.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]")
let a = "[\\?&]" + b + "=([^&#]*)"
let d = new RegExp(a)
let c = d.exec(window.location.href)
if (c === null) return ''
else return c[1]
}