asp中java调用问题请教

rayyu1989 2008-07-03 08:20:17
<% 
dim rayyu_air920
rayyu_air920 = trim(request("style"))
if rayyu_air920= "3" then
Response.Write("<form id=korayipform name=korayipform method=post action='http://www.yy313.cn/air/htm%2Djs/ip/index.asp?' target='_blank'><a style='font-size:12px;'><input name=pw1 id=pw1 type=text size=48 maxlength=100 value='你当前ip:"+getip+"||"+getaddress(getip)+"'"+"style='color:#FF0000' onFocus=this.value='' onBlur=this.value='请输入要查询的ip地址,然后点查询或回车'><input type=submit name=Submit value=查询><input type=hidden name=action value=ip></a></form>")
end if
%>


上面的代码直接在ie输入xxx.asp?xx=3可以调用,我要使用
<script type="text/javascript" src="xxx.asp?xx=3"></script>

该如何写Response.Write中的语句呢
...全文
111 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
rayyu1989 2008-07-03
  • 打赏
  • 举报
回复
哇,真的也,删了css就可以了,谢谢了
neo_yoho 2008-07-03
  • 打赏
  • 举报
回复
你这个页面前面还加了CSS 不想麻烦就把那一段CSS删掉
不怕麻烦就改成类似那个if的输出
rayyu1989 2008-07-03
  • 打赏
  • 举报
回复
getaddress是获取得到的ip的物理地址的
rayyu1989 2008-07-03
  • 打赏
  • 举报
回复
还是提示语法错误,,,
http://www.yy313.cn/ip/getip.asp?style=0

你<script src="http://www.yy313.cn/ip/getip.asp?style=0"></script>下看看
rayyu1989 2008-07-03
  • 打赏
  • 举报
回复
function GetIp() 
dim realip,proxy
realip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
proxy = Request.ServerVariables("REMOTE_ADDR")
if realip = "" then
GetIp = proxy
else
GetIp = realip
end if
end function
neo_yoho 2008-07-03
  • 打赏
  • 举报
回复
xxx.asp

Function getaddress(ip)
getaddress="aa"
End function
'我不知道你的getaddress是干什么用的哈

getip=Request.ServerVariables("REMOTE_ADDR")

dim rayyu_air920
rayyu_air920 = trim(request("style"))
if rayyu_air920= "3" then
str = "<form id=korayipform name=korayipform method=post action='http://www.yy313.cn/air/htm%2Djs/ip/index.asp?' target='_blank'><a style='font-size:12px;'><input name=pw1 id=pw1 type=text size=48 maxlength=100 value='你当前ip:"+getip+"||"+getaddress(getip)+"'"+"style='color:#FF0000' onFocus=this.value='' onBlur=this.value='请输入要查询的ip地址,然后点查询或回车'><input type=submit name=Submit value=查询><input type=hidden name=action value=ip></a></form>"

Response.Write("document.write("&Chr(34)&str&Chr(34)&")")
end if


引用页面

<script src="xxx.asp?style=3"></script>
rayyu1989 2008-07-03
  • 打赏
  • 举报
回复
提示语法错误
rayyu1989 2008-07-03
  • 打赏
  • 举报
回复
一样的结果,。。,没东西
neo_yoho 2008-07-03
  • 打赏
  • 举报
回复
if中的那段换成上面的试下
neo_yoho 2008-07-03
  • 打赏
  • 举报
回复

str = "<form id=korayipform name=korayipform method=post action='http://www.yy313.cn/air/htm%2Djs/ip/index.asp?' target='_blank'><a style='font-size:12px;'><input name=pw1 id=pw1 type=text size=48 maxlength=100 value='你当前ip:"+getip+"||"+getaddress(getip)+"'"+"style='color:#FF0000' onFocus=this.value='' onBlur=this.value='请输入要查询的ip地址,然后点查询或回车'><input type=submit name=Submit value=查询><input type=hidden name=action value=ip></a></form>"
Response.Write "document.write("&Chr(34)&str&Chr(34)&")"
rayyu1989 2008-07-03
  • 打赏
  • 举报
回复
就是不懂语法,大哥帮我把上面的例子改下啦,谢谢啦
neo_yoho 2008-07-03
  • 打赏
  • 举报
回复
java? 是javascript吧...
<script type="text/javascript" src="xxx.asp?xx=3"> </script>中的
xxx.asp?xx=3中生成的输出内容要符合javascript语法
rayyu1989 2008-07-03
  • 打赏
  • 举报
回复
没反应。。。
rayyu1989 2008-07-03
  • 打赏
  • 举报
回复
不能用<script type="text/javascript" src="xxx.asp?xx=3"></script>调用吗???。
老紫竹 2008-07-03
  • 打赏
  • 举报
回复
Response.Write("document.write('alert(1234);');");

你这样看看,可可!
老紫竹 2008-07-03
  • 打赏
  • 举报
回复
和 Java有关系吗? 没看出来啊!

28,390

社区成员

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

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