程序如何获取到js的值

logoso 2012-10-27 10:15:58


<script type=text/javascript src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js" charset="gb2312"></script>
<script type=text/javascript>

//alert(remote_ip_info.province);弹出IP所在省份
//alert(remote_ip_info.city);弹出IP所在市
//remote_ip_info.province
//remote_ip_info.city
</script>
如何把remote_ip_info.province和remote_ip_info.city的值传给下面的省和市

<%
set rs = server.CreateObject("adodb.recordset")
rs.open "Select * From news Where 省='"&xl&"' and 市='"&xid&"' order by id desc " ,conn,1,1
do while not rs.eof


Response.Write "document.write('<li>');"
Response.Write "document.write('<a href="&rs("id")&".html>');"
Response.Write "document.write('</a>');"
Response.Write "document.write('</li>');"

rs.movenext
loop
rs.close
set rs = nothing
%>


...全文
163 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
logoso 2012-10-27
  • 打赏
  • 举报
回复


<script type=text/javascript src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js" charset="gb2312"></script>
<script type=text/javascript>

//alert(remote_ip_info.province);弹出IP所在省份
//alert(remote_ip_info.city);弹出IP所在市
//remote_ip_info.province
//remote_ip_info.city
</script>
如何把remote_ip_info.province和remote_ip_info.city的值传给下面的省和市

<script type=text/javascript src="http://www.ab.com/1.asp?省=remote_ip_info.province&市=remote_ip_info.city" charset="gb2312"></script>


这种调用我又该怎么做呢
重学编程 2012-10-27
  • 打赏
  • 举报
回复
你可以先弄个隐藏域嘛,然后通过js的document.getElementById('隐藏域的id').value设置值,然后jsp中就用request.getParameter("隐藏域的name")获取值就是是取了js的值
logoso 2012-10-27
  • 打赏
  • 举报
回复
具体做法能不能不能说清楚点,或提供点代码参考
重学编程 2012-10-27
  • 打赏
  • 举报
回复
把js的值放到表单中,jsp再去取表单的中值不就行了
微信小程序获取textarea的详解 在这里我们可以借用form表单来获取textarea的 wxml的代码: