关于
在ie 和fox的兼容性问题

ymf1223 2008-11-11 05:55:04
if Session("Tit")>2 then
Response.Write("<form name=""listform"" action=""info_list.asp"" method=""GET"" target=""JyDown_w32"">")
else
Response.Write("<form name=form1 >")
end if
thistype=thistype & "<a class=JyDownSort href=info_sort.asp>系统首页</a>"
if request("id")<>"" then
rs.open "select * from infotype where id="&request("id"),conn,1,1
if not rs.EOF then
ts=rs("ts")
tj=rs("tj")
TN=split(rs("tname"),"|")
TI=split(rs("ts"), ",")
for i = 0 to ubound(TN)-1
thistype=thistype & "<font color=#ffffff>>></font> <a class=JyDownSort href=info_sort.asp?id="&TI(i)&">"&TN(i)&"</a>"
next
Response.Write("<input type=""hidden"" name=""id"" value=""" & rs("id") & """>")
Response.Write("<input type=""hidden"" name=""tname"" value=""" & rs("tname") & """>")
Response.Write("<input type=""hidden"" name=""ts"" value=""" & rs("ts") & """>")
Response.Write("<input type=""hidden"" name=""tj"" value=""" & rs("tj") & """>")
else
response.write "<b>错误:</b>此ID号的类别不存在或已被删除!"
response.end
end if
rs.close
end if
Response.Write("<input type=""hidden"" name=""type"" value=""" & thistype & """></form>")
if Session("Tit")>2 then
Response.Write("<script language=""JavaScript"">document.listform.submit()</script>")
end if
%>


上面代码在ie 里运行正常。 到fox里提示这句出错Response.Write("<script language=""JavaScript"">document.listform.submit()</script>")
说document.listform is undefined. 请问高手们,应该如何修改啊?
...全文
137 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
starwu 2008-11-11
  • 打赏
  • 举报
回复
为什么危险?看看什么叫SQL注入漏洞吧!
neo_yoho 2008-11-11
  • 打赏
  • 举报
回复
替换parent.topwin.cols为
parent.document.getElementById("topwin").cols
试试
ymf1223 2008-11-11
  • 打赏
  • 举报
回复
screen换成其他的还是一样不行
varlj 2008-11-11
  • 打赏
  • 举报
回复
firefox里面,screen是系统已经定义的,换个变量名字就好了

看下这个,安全
http://blog.joycode.com/scottgu/archive/2006/10/02/84561.aspx
ymf1223 2008-11-11
  • 打赏
  • 举报
回复
非常感谢大家帮助,用neo_yoho 的方法在fox里已经正常了。
请问这句rs.open "select * from infotype where id="&request("id") 该如何摆脱危险
还有这段

<SCRIPT language=javascript>
var screen=false;
var i=0;width=0;
function JyDownWindow()
{
if(screen==false)
{
parent.topwin.cols='0,8,*';
screen=true;
}
else if(screen==true)
{
parent.topwin.cols='183,7,*';
screen=false;
}
}
</SCRIPT>
在ie里正常,在fox里却提示var screen=false;这个错误
kindwell 2008-11-11
  • 打赏
  • 举报
回复
把Response.Write(" <script language=""JavaScript"">document.listform.submit() </script>")
这句放到最后面写,也就是在<form>等元素已经输出了以后再调用这句。
varlj 2008-11-11
  • 打赏
  • 举报
回复
这样很危险诶

rs.open "select * from infotype where id="&request("id")
neo_yoho 2008-11-11
  • 打赏
  • 举报
回复
document.listform.submit() 换成
window.onload=function(){document.listform.submit()}
试试
1. HTML对象获取问题 3 2. const问题 3 3. event.x与event.y问题 3 4. window.location.href问题 3 5. frame问题 3 6. 模态和非模态窗口问题 3 7. firefox与IE的父元素(parentElement)的区别 3 8. document.formName.item(”itemName”) 问题 3 9. 集合类对象问题 3 10. 自定义属性问题 3 11. input.type属性问题 3 12. event.srcElement问题 3 13. body载入问题 3 14. 事件委托方法 3 15. Table操作问题 3 16. 对象宽高赋值问题 3 Ø CSS 3 1. cursor:hand VS cursor:pointer 3 2. innerText在IE中能正常工作,但在FireFox中却不行. 3 3. CSS透明 3 4. css中的width和padding 3 5. FF和IE BOX模型解释不一致导致相差2px 3 6. IE5 和IE6的BOX解释不一致 3 7. ul和ol列表缩进问题 3 8. 元素水平居中问题 3 9. Div的垂直居中问题 3 10. margin加倍的问题 3 11. IE与宽度和高度的问题 3 12. 页面的最小宽度 3 13. DIV浮动IE文本产生3象素的bug 3 14. IE捉迷藏的问题 3 15. float的div闭合;清除浮动;自适应高度 3 16. 高度不适应 3 17. IE6下图片下有空隙产生 3 18. 对齐文本与文本输入框 3 19. LI中内容超过长度后以省略号显示 3 20. 为什么web标准中IE无法设置滚动条颜色了 3 21. 为什么无法定义1px左右高度的容器 3 22. 链接(a标签)的边框与背景 3 23. 超链接访问过后hover样式就不出现的问题 3 24. FORM标签 3 25. 属性选择器(这个不能算是兼容,是隐藏css的一个bug) 3 26. 为什么FF下文本无法撑开容器的高度 3

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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