HTML——ASP的 Response.write 方法输出中文乱码解决方案
生活随笔
收集整理的這篇文章主要介紹了
HTML——ASP的 Response.write 方法输出中文乱码解决方案
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
ASP的 Response.write方法輸出的數(shù)據(jù)可能造成亂碼問題
可以添加HTML的head標簽限制頁面的編碼和限制ASP的編碼解決
<!DOCTYPE html> <html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>2019干事申請表</title><link rel="stylesheet" href="./assets/css/apply.css"><script src="./assets/js/jquery-1.9.1.min.js"></script> </head> <%@Language="vbscript" Codepage="65001"%> <%response.Write "<div class='data'>"response.Write "提交數(shù)據(jù)..."if session("apply")="" thenresponse.write "<script language='javascript'>alert('申請?zhí)顖蟪瑫r');</script>"response.write "<script language='javascript'>window.location.href='application.asp';</script>" end ifstarttime=cdate("2019-9-1 9:00:00")endtime=cdate("2019-9-30 23:59:59")nowtime = now()response.Write(datediff("s",starttime,nowtime))response.Write(datediff("s",nowtime,endtime)) if datediff("s",starttime,nowtime)<0 or datediff("s",nowtime,endtime)<0 thenresponse.write "<script language='javascript'>"response.write "alert('不在申請時間范圍內(nèi),如有疑問詢問浙理計協(xié)!');"response.write "window.history.back(-1);"response.write "</script>"else %><!--#include file="conn.asp"--> <%z="here"if request.form<>"" thenFOR EACH name IN Request.Formresponse.Write(request.form(name))NEXTend ifresponse.Write(z) response.Write(conn.state) '顯示連接狀態(tài),若為1表示連接成功,若為0連接失敗。xm=request.Form("name")xh=request.Form("id")xb=request.Form("gender")yx=request.Form("email")dh=request.Form("tel")qq=request.Form("qq")xy=request.Form("college")zy=request.Form("major")bj=request.Form("class")first=request.Form("select")secondd=request.Form("selectt")text=request.Form("message")idea=request.Form("idea")z="here"response.Write(z) 'rs.open "select * from 2019xsjbxx where sfzh='" & u & "' and tzsh='" & p & "'",conn,1response.Write(first) 'str = "updata [userinfo] set realname='" & r & "',sex='" & s & "',city='" & c & "',phone='" & p & "',email='" & e & "',memo='" & m & "' where username='" & session("username") & "'"str ="INSERT INTO sqb SELECT '" & xm & "','" & xh & "','" & xb & "','" & yx & "','" & dh & "','" & qq & "' ,'" & xy & "','" & zy & "','" & bj & "','" & first & "','" & secondd & "','" & text & "','" & idea & "'"response.Write(str) conn.execute strif conn.errors.count>0 thenresponse.write "<script> alert('數(shù)據(jù)庫錯誤!');</script>"else response.write "<script> alert('提交申請表成功!');</script>"end ifresponse.write "<script language='javascript'>$(function () { $('.popup').addClass('hide');$('.container').html('');$('.data').html('');$('.container').addClass('background');$('.container.background').lazyload();var done = $('#done').html();$('.container').append(done);});</script>"'response.write "<script language='javascript'>window.location.href='/';</script>"'rs.close'set rs=nothingconn.closeset conn=nothing end if response.Write "</div>" session("apply")="" %> <body style="height: 100vh"><div class="container" data-original="./assets/img/ground.jpg"><div class='popup' style='height:200px'><img src='./assets/img/loading.gif'> <div>正在提交...</div> </div></div> </body> <script src="./assets/js/jquery.lazyload.js"></script> <script type="application/xml" id="done"><div><div class="done"><div class="success"><img src="./assets/img/done.png"/><div>報名成功!</div></div><div>請耐心等待<br/>我們的筆試/面試通知吧~</div></div><div class="footer">計算機協(xié)會</div></div> </script><script language="javascript">$(function () { console.log($(".popup"));console.log($(".container"));function success() {$(".popup").addClass('hide');$(".container").html("");//$container.addClass("background");//$(".container.background").lazyload();var done = $('#done').html();$(".container").append(done);}}); </script> </html>?
與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的HTML——ASP的 Response.write 方法输出中文乱码解决方案的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 网页设计/移动开发学习资源推荐
- 下一篇: 2017年html5行业报告,云适配发布