JS正则提取URL中关键字
想从网址:http://127.0.0.1/plus/search.php?kwtype=0&q=%B9%C9%C6%B1提取出q=后面的关健字,然后,改动一下,下面代码...
想从网址: http://127.0.0.1/plus/search.php?kwtype=0&q=%B9%C9%C6%B1 提取出q=后面的关健字,然后,改动一下,下面代码加粗的部分,使整代码能正常工作 请高手指点一下,谢谢 <script type="text/javascript"> google.load('search', '1', {language : 'zh-CN'}); google.setOnLoadCallback(function(){ var customSearchControl = new google.search.CustomSearchControl('009527755525159401988:63iuuetccag'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); customSearchControl.draw('cse'); var match = location.search.match(/q=([^&]*)(&|$)/); if(match && match[1]){ var search = decodeURIComponent(match[1]); customSearchControl.execute(search); } }); </script>
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询