⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getcity.asp

📁 ajax 通过省份名显示城市名称,这个源码经测试通过
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT.Encode" CODEPAGE="65001"%>
<!--#include file="Inc/conn.inc"-->
<%
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"

provinceId = CInt(request("provinceId"))

set con=getConn()
set rs=getRs()

sql="select CityID, CityPostCode, CityName from ChinaCity where Right(CityPostCode, 2) = '00'"
sql=sql&" and Left(CityPostCode, 2)='"&provinceId&"' and Right(CityPostCode, 4) <> '0000' order by [CityID]"
rs.open sql,con,1,1
			
while not rs.bof and not rs.eof
	outStr=outstr & Left(rs("CityPostCode"), 4)&"-"&rs("CityName") & ","
	rs.movenext
wend
			
rs.close
con.close

outStr=left(outStr, len(outStr)-1)	'remove the last ','
response.Write(outStr)
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -