如果是get方式,等价与window.location.href="temp.asp?a=1&b=9&c=3";

解决方案 »

  1.   

    是这样不?
    在确保不会有在参数中不有地址连接符的情况下可以这样用function createform(url){
            var newform = '<form name="form1" method="get" action="' + (url = url.split("?"))[0] + '">\n';
            url = url[1].split('&');
            for(var i = 0; i < url.length; i++){
               newform = newform + '<input name="' + url[i].split("=")[0] + '" type="hidden" id="' + url[i].split("=")[0] + '" value="' + url[i].split("=")[1] + '">\n';
            }
            newform += '</form>';
            return newform;
    }
    alert(createform('temp.asp?a=1&b=9&c=3'));