简单的代码转换

Jagen在路上 2003-03-12 04:53:41
请问下面这部分代码用JAVASCRIPT怎么实现
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>获取系统信息</title>
</head>
<body>
<%
Response.Write("运行ASP文件的路径:" + Request.ServerVariables("SCRIPT_NAME"))
Response.Write("<br>返回content的数据长度:" + Request.ServerVariables("CONTENT_LENGTH"))
Response.Write("<br>返回客户的IP地址:" + Request.ServerVariables("REMOTE_ADDR"))
Response.Write("<br>浏览器名:" + Request.ServerVariables("HTTP_USER_AGENT"))
Response.Write("<br>返回主页实际的物理路径:" + Request.ServerVariables("APPL_PHYSICAL_PATH"))
%>
<table cols="8" cellpadding="5" border="0">
<tr>
<td align="center" bgcolor="#800000" width="109"><font style="ARIAL NARROW" color="#FFFFFF" size="2">环境变量名</font></td>
<td align="center" width="459" bgcolor="#800000"><font style="ARIAL NARROW" color="#FFFFFF" size="2">结果</font></td>
</tr>
<%
dim Sv
for each Sv in Request.ServerVariables
Response.Write"<tr>"
Response.Write"<td bgcolor='f7efde' align = center><font style='ARIAL NARROW' size='2'>"
Response.Write Sv
Response.Write"</font></td>"
Response.Write"<td bgcolor='f7efde' align = center><font style='ARIAL NARROW' size='2'>"
Response.Write Request.ServerVariables(Sv)
Response.Write"</font></td></tr>"
next
%>
</table>
</body>
</html>
...全文
33 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jagen在路上 2003-03-12
  • 打赏
  • 举报
回复
是的,没错
par 2003-03-12
  • 打赏
  • 举报
回复
我想问问,楼主想是用JAVASCRIPT服务器脚本<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>,换了上面哪个VBSCRIPT服务器脚本<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>?

注意:我说的是服务器脚本!不是浏览器脚本。
Jagen在路上 2003-03-12
  • 打赏
  • 举报
回复
par(劏狗劏猫劏老鼠的---吾知道) 给的程序很有价值,但是我所提问的不是这方面内容,而是对我提供的代码的简单转换,我给的代码是VBSCRIPT实现的asp程序,我想用JAVASCRIPT实现完全一样的程序,只是做一个简单的转换,我想了解for each 用JAVASCRIPT的实现方法,我用 for in不好使
再次感谢 par(劏狗劏猫劏老鼠的---吾知道) 的回复
par 2003-03-12
  • 打赏
  • 举报
回复
部分功能难实现
par 2003-03-12
  • 打赏
  • 举报
回复
<html xmlns:ie>

<head>
<title>VN.ST.</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
@media all {
IE\:CLIENTCAPS {behavior:url(#default#clientCaps)}
}
-->
</style>
<style type="text/css">p, td, input { font-style: normal; font-variant: normal; font-weight: normal; font-size: 9pt;
font-family: 宋体, 'MS Song'; cursor: default;padding:3px}
body { font-style: normal; font-variant: normal; font-weight: normal; font-size: 9pt;
font-family: 宋体, 'MS Song'; color: windowtext;
background-color: menu; background-repeat: repeat;
background-attachment: scroll; background-position: 0% }
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="1_2.gif">
<IE:CLIENTCAPS ID="oClientCaps" /> <br>
<table width="81%" border="1" align="center" cellspacing="1" cellpadding="0" bordercolor="#666699">
<tr>
<td background="iebg.gif"><font color="#FFFFFF"><b><font size="3"> 系统检测</font></b></font></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="sm9pt" bgcolor="#1892B5" align="center">
<tr>
<td width="92" class="td1" bgcolor="#FFFFFF">浏览器类型</td>
<td width="133" class="td1" bgcolor="#FFFFFF">
<script>document.write(navigator.appName)</script>
</td>
<td width="130" class="td1" bgcolor="#FFFFFF">颜色</td>
<td width="122" class="td1" bgcolor="#FFFFFF">
<script>document.write(window.screen.colorDepth+"位")</script>
</td>
</tr>
<tr>
<td width="92" bgcolor="#FFFFFF">浏览器版本</td>
<td width="133" bgcolor="#FFFFFF">
<script>document.write(navigator.appVersion)</script>
</td>
<td width="130" bgcolor="#FFFFFF">字体平滑</td>
<td width="122" bgcolor="#FFFFFF">
<script>document.write(window.screen.fontSmoothingEnabled)</script>
</td>
</tr>
<tr>
<td width="92" class="td1" bgcolor="#FFFFFF">浏览器语言</td>
<td width="133" class="td1" bgcolor="#FFFFFF">
<script>document.write(navigator.browserLanguage)</script>
</td>
<td width="130" class="td1" bgcolor="#FFFFFF">appMinorVersion</td>
<td width="122" class="td1" bgcolor="#FFFFFF">
<script>document.write(navigator.appMinorVersion)</script>
</td>
</tr>
<tr>
<td width="92" bgcolor="#FFFFFF" height="20">CPU类型</td>
<td width="133" bgcolor="#FFFFFF" height="20">
<script>document.write(navigator.cpuClass)</script>
</td>
<td width="130" bgcolor="#FFFFFF" height="20">appCodeName</td>
<td width="122" bgcolor="#FFFFFF" height="20">
<script>document.write(navigator.appCodeName)</script>
</td>
</tr>
<tr>
<td width="92" class="td1" bgcolor="#FFFFFF">操作系统</td>
<td width="133" class="td1" bgcolor="#FFFFFF">
<script>document.write(navigator.platform)</script>
</td>
<td width="130" class="td1" bgcolor="#FFFFFF">cookieEnabled</td>
<td width="122" class="td1" bgcolor="#FFFFFF">
<script>document.write(navigator.cookieEnabled)</script>
</td>
</tr>
<tr>
<td width="92" bgcolor="#FFFFFF">系统语言</td>
<td width="133" bgcolor="#FFFFFF">
<script>document.write(navigator.systemLanguage)</script>
</td>
<td width="130" bgcolor="#FFFFFF">userAgent</td>
<td width="122" bgcolor="#FFFFFF">
<script>document.write(navigator.userAgent)</script>
</td>
</tr>
<tr>
<td width="92" class="td1" bgcolor="#FFFFFF">用户语言;</td>
<td width="133" class="td1" bgcolor="#FFFFFF">
<script>document.write(navigator.userLanguage)</script>
</td>
<td width="130" class="td1" bgcolor="#FFFFFF">javaEnabled</td>
<td width="122" class="td1" bgcolor="#FFFFFF">
<script>document.write(navigator.javaEnabled())</script>
</td>
</tr>
<tr>
<td width="92" bgcolor="#FFFFFF">在线情况</td>
<td width="133" bgcolor="#FFFFFF">
<script>document.write(navigator.onLine)</script>
</td>
<td width="130" bgcolor="#FFFFFF">taintEnabled</td>
<td width="122" bgcolor="#FFFFFF">
<script>document.write(navigator.taintEnabled())</script>
</td>
</tr>
<tr>
<td width="92" class="td1" bgcolor="#FFFFFF">屏幕分辨率</td>
<td width="133" class="td1" bgcolor="#FFFFFF">
<script>document.write(window.screen.width+"x"+window.screen.height)</script>
</td>
<td width="130" class="td1" bgcolor="#FFFFFF">connectionType</td>
<td width="122" class="td1" bgcolor="#FFFFFF">
<script>document.write(oClientCaps.connectionType)</script>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>

</html>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧