js中settimeout方法加参数的使用. 简单使用看w3school 里面没有参数调用, 例子: <script type="text/javascript"> function timedMsg() { var a ="dd"; var t=setTimeout(function(){ cao(a);},3000) } function cao(a) { alert(a); } www.jbxue.com </scrip…
/** * js获得url内的参数 * 返回值: string or undefined * 使用方法:$_GET['from'] */ var $_GET = (function() { var search = location.search; if (search == '') { return {}; } search = search.split('?')[1]; search = search.split('&'); var get = {}; for (var i in searc…
方法一:正则法 function getQueryString(name) { var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); var r = window.location.search.substr(1).match(reg); if (r != null) { return unescape(r[2]); } return null; } // 这样调用: alert(GetQueryString(&q…