function getURLParameter(name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ""])[1].replace(/+/g, '%20')) || null; }
https://i.cnblogs.com/EditPosts.aspx?opt=1
调用方法:
getURLParameter('opt');
结果为1