附上我的例子:——————————————————————————————
js文件
function autoComplete()
{
this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
this.items = new Array();
this.fieldList = new Array();
this.xmldoc = "";
this.select = "";
this.url = "";
this.target = "";
this.error = false;
}
//========== 文档加载时创建对象 =========
autoComp = new autoComplete();
autoComp.filedList = ['company','contact','tel','address'];
alert(autoComp.filedList);
——————————————————————————————
htm文件
<HTML>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta content=0 http-equiv=Expires>
<style>
.mine{
behavior:url(aaa.htc);
}
</style>
<script src="autoComplete.js"></script></head>
<body>
<table border="1" class="mine"><tr><td>test:</td></tr><table>
</body>
</html>——————————————————————————————
htc文件
<PUBLIC:ATTACH EVENT="onclick" ONEVENT="init()"/>
<SCRIPT LANGUAGE="JavaScript">
function init(){
alert(autoComp.filedList);
}
</SCRIPT>