t.html
<!DOCTYPE html> <html> <head> <Meta charset="UTF-8"> <title>Insert title here</title> <script type="text/javascript"> var getParam = function(name){ var search = document.location.search; var pattern = new RegExp("[?&]"+name+"\=([^&]+)","g"); var matcher = pattern.exec(search); var items = null; if(null != matcher){ try{ items = decodeURIComponent(decodeURIComponent(matcher[1])); }catch(e){ try{ items = decodeURIComponent(matcher[1]); }catch(e){ items = matcher[1]; } } } return items; }; window.onload=function(){ alert(getParam('ids')); alert(getParam('cid')); } </script> </head> <body> <h1>111111111</h1> </body> </html>