var getQueryString = function(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return r[2]; return "";
}
补充:
myjs.js 代码:
function foo(){
var str = "abc";
//document.forms[0].hid.value = str;
var frm = window.event.srcElement;
frm.hid.value = str;
return true;
}