document.writeln("");document.writeln("");document.writeln("请您留言
");document.writeln(" 打开");document.writeln("");var url = "XXX";var par;var a = document.getElementById("tanchuangwai");var b = document.getElementById("guanbi");var p; var s;var h;function goPanel(){ document.getElementById("tanchuangwai").style.display = "none"; p = document.getElementById("tanchuang"); p.style.display = "block"; p.style.height = "29px"; s = setInterval(upPanel,1);}function goClose(){ p = document.getElementById("tanchuang"); h = setInterval(downPanel,1);}function upPanel(){ var height = parseInt(p.style.height.replace("px","")); height = height + 3; p.style.height = height+"px"; if(height >= 281){ clearInterval(s); }}function downPanel(){ var height = parseInt(p.style.height.replace("px","")); height = height - 3; p.style.height = height+"px"; if(height <= 29){ clearInterval(h); p.style.display = "none"; document.getElementById("tanchuangwai").style.display = "block"; }}function ajax(){ var oAjax = null; if(window.XMLHttpRequest){ oAjax = new XMLHttpRequest(); }else{ oAjax = new ActiveXObject("Microsoft.XMLHTTP"); }; oAjax.open('POST', url, true); oAjax.setRequestHeader("Content-type","application/x-www-form-urlencoded"); var area = document.getElementById("pArea").value; var sel = document.getElementById("pSel").value; var name = document.getElementById("pName").value; var tel = document.getElementById("pTel").value; var url1 = window.location.href; oAjax.send("area=" + area + "&sel=" + sel + "&name=" + name + "&tel=" + tel + "&par=" + par + "&url=" + url1); oAjax.onreadystatechange = function(){ if(oAjax.readyState == 4){ if(oAjax.status == 200){ alert(oAjax.responseText) }else{ alert("请求错误"); } } };}function sub() { var js = document.getElementsByTagName("script"); for (var i = 0; i < js.length; i++) { if (js[i].src.indexOf("panel.min.js") >= 0) { var arraytemp = new Array(); arraytemp = js[i].src.split('?'); arraytemp = arraytemp[1].split('='); if (arraytemp[0] == 'value') { par = arraytemp[1]; } } }; ajax();}");document.writeln("");document.writeln("请您留言
");document.writeln(" 关闭");document.writeln(" ");document.writeln("");document.writeln("类型");document.writeln(" ");document.writeln("");document.writeln("姓名");document.writeln(" ");document.writeln("");document.writeln("电话");document.writeln(" ");document.writeln("");document.writeln(" ");document.writeln("
同样的代码,这是修改后的使用ajax上传图片的代码:
var url = "http://XXX";document.writeln("");document.writeln("");document.writeln("请您留言
");document.writeln(" 打开");document.writeln("");document.writeln("");var par;var upload = "WebForm3.aspx";var a = document.getElementById("tanchuangwai");var b = document.getElementById("guanbi");var p; var s;var h;var scs;function goPanel(){ document.getElementById("tanchuangwai").style.display = "none"; p = document.getElementById("tanchuang"); p.style.display = "block"; p.style.height = "28px"; s = setInterval(upPanel,1);}function goClose(){ p = document.getElementById("tanchuang"); h = setInterval(downPanel,1);}function upPanel(){ var height = parseInt(p.style.height.replace("px","")); height = height + 3; p.style.height = height+"px"; if(height >= 313){ clearInterval(s); }}function downPanel(){ var height = parseInt(p.style.height.replace("px","")); height = height - 3; p.style.height = height+"px"; if(height <= 29){ clearInterval(h); p.style.display = "none"; document.getElementById("tanchuangwai").style.display = "block"; }}function ajax(){ var oAjax = null; if(window.XMLHttpRequest){ oAjax = new XMLHttpRequest(); }else{ oAjax = new ActiveXObject("Microsoft.XMLHTTP"); }; oAjax.open('POST', url, true); var area = document.getElementById("pArea").value; var sel = document.getElementById("pSel").value; var name = document.getElementById("pName").value; var tel = document.getElementById("pTel").value; var url1 = window.location.href; var fd = new FormData(); fd.append('area', area); fd.append('sel', sel); fd.append('name', name); fd.append('tel', tel); fd.append('par', par); fd.append('url', url1); fd.append("img", document.getElementById("img").files[0]); oAjax.send(fd); oAjax.onreadystatechange = function(){ if(oAjax.readyState == 4){ if(oAjax.status == 200){ alert(oAjax.responseText) }else{ alert("请求错误"); } } };}function sub() { var js = document.getElementsByTagName("script"); for (var i = 0; i < js.length; i++) { if (js[i].src.indexOf("panel.js") >= 0) { var arraytemp = new Array(); arraytemp = js[i].src.split('?'); arraytemp = arraytemp[1].split('='); if (arraytemp[0] == 'value') { par = arraytemp[1]; } } }; document.getElementById("par").value = par; ajax();}");document.writeln("");document.writeln("请您留言
");document.writeln(" 关闭");document.writeln(" ");document.writeln("");document.writeln("类型");document.writeln(" ");document.writeln("");document.writeln("姓名");document.writeln(" ");document.writeln("");document.writeln("电话");document.writeln(" ");document.writeln("");document.writeln("上传");document.writeln(" ");document.writeln("");document.writeln(" ");document.writeln("