Home > Web Front-end > HTML Tutorial > 下面html中JS能在IE上显示出来查询结果,为什么火狐上没有反应?_html/css_WEB-ITnose

下面html中JS能在IE上显示出来查询结果,为什么火狐上没有反应?_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:34:21
Original
852 people have browsed it

nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




无标题文档



<script> <br />var objdbConn=new ActiveXObject("ADODB.Connection"); <br />var strdsn = "Driver={SQL Server};SERVER=.;UID=sa;PWD=123;DATABASE=PointCard"; <br />objdbConn.Open(strdsn); <br />var objrs=objdbConn.Execute("SELECT [head] FROM news"); <br />var fdCount=objrs.Fields.Count-1; <br />if(!objrs.EOF) <br />{ <br />document.write("<table border=1><tr>"); <br /> for (var i=0;i<=fdCount;i++) <br /> document.write("<td><b>"+objrs.Fields(i).Name+""); <br /> document.write(""); <br /> while(!objrs.EOF){ <br /> document.write("<tr>"); <br /> for (i=0;i<=fdCount;i++) <br /> document.write("<td valign='top'>"+objrs.Fields(i).Value+""); <br /> document.write(""); <br /> objrs.moveNext(); <br /> } <br /> document.write(""); <br /> } <br /> else <br /> document.write("数据库内没有记录!<br>"); <br /> objrs.Close(); <br /> objdbConn.Close(); <br /> </script>


回复讨论(解决方案)

new ActiveXObject("ADODB.Connection");
这个对象只有ie才支持,火狐不支持

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template