JavaScript Access´úÂë²Î¿¼
///ÏÂÃæÊǶÔAccessµÄÁ´½Ó
function getCountfromDB() {
//ÒÔµ±Ç°Ò³ÃæÎļþΪ»ù´¡£¬ÕÒµ½ÎļþËùÔڵľø¶Ô·¾¶¡£
var filePath = location.href.substring(0, location.href.indexOf("Cnt.htm"));
var path = filePath + "MyData.mdb";
//È¥µô×Ö·û´®ÖÐ×îÇ°ÃæµÄ"files://"Õâ8¸ö×Ö·û¡£
path = path.substring(8);
var updateCnt = 0;
//Éú³É²éѯºÍ¸üÐÂÓõÄsqlÓï¾ä¡£
var sqlSelCnt = "SELECT COUNT from [COUNT] WHERE ID = 'count'";
var sqlUpdCnt = "UPDATE [COUNT] SET [COUNT] = '";
//½¨Á¢Á¬½Ó£¬²¢Éú³ÉÏà¹Ø×Ö·û´®
var con = new ActiveXObject("ADODB.Connection");
con.Provider = "Microsoft.Jet.OLEDB.4.0";
con.ConnectionString = "Data Source=" + path;
con.open;
//rs¼Ç¼±íµÄ½¨Á¢
var rs = new ActiveXObject("ADODB.Recordset");
rs.open(sqlSelCnt, con);
while (!rs.eof) {
var cnt = rs.Fields("COUNT");
document.write(cnt);
//½«È¡µÃ½á¹û¼Ó1ºó¸üÐÂÊý¾Ý¿â¡£
updateCnt = cnt * 1 + 1;
rs.moveNext;
}
rs.close();
rs = null;
sqlUpdCnt = sqlUpdCnt + updateCnt + "'";
con.execute(sqlUpdCnt);
con.close();
con = null;
}
//ÏÂÃæÊÇÓëÎı¾½¨Á¢ÁªÏµ
function getCountfromTxt() {
var filePath = location.href.substring(0, location.href.indexOf("Cnt.htm"));
var path = filePath + "count.txt";
path = path.substring(8);
var nextCnt = 0;
&
Ïà¹ØÎĵµ£º
Òý×Ó
±à³ÌÊÀ½çÀïÖ»´æÔÚÁ½ÖÖ»ù±¾ÔªËØ£¬Ò»¸öÊÇÊý¾Ý£¬Ò»¸öÊÇ´úÂë¡£±à³ÌÊÀ½ç¾ÍÊÇÔÚÊý¾ÝºÍ´úÂëǧ˿ÍòÂƵľÀ²øÖгÊÏÖ³öÎÞÏÞµÄÉú»úºÍ»îÁ¦¡£
Êý¾ÝÌìÉú¾ÍÊÇÎľ²µÄ£¬×ÜÏë±£³Ö×Ô¼º¹ÌÓеı¾É«£»¶ø´úÂëÈ´ÌìÉú»îÆã¬×ÜÏë¸Ä±äÕâ¸öÊÀ½ç¡£
Äã¿´£¬Êý¾Ý´úÂë¼äµÄ¹ØϵÓëÎï ......
//¹ýÂËËùÓеķÇÖÐÎÄ,×Öĸ,Êý×Ö×Ö·û
function filter_str(str)
{
interval=typeof(arguments[1])!='undefined'?arguments[1]:' ';
if(str.length>0)str=DBC2SBC(str)
return str.replace(/[^\u4E00-\u9FA5a-zA-Z0-9]/g,in ......
// PageLoadʼþ
var onloadMethod = window.onload;
window.onload = window_Load;
function window_Load() {
var i;
var item;
// È«²¿Á¬½ÓµÄʼþ
for (i = 0; i < document.links.length; i ++) {
item = document.links[i]
Object.Aspect.around(item, "onclick", checkLoading);
}
// È«²¿°´Å ......
×Û¹ÛÒ»¸öϵͳµÄ·¢Õ¹£¬ÎÞ·ÇÊÇ·¢ÏÖÒ»¸öÎÊÌâ¾Í°ÑËü¶ÀÁ¢³öÀ´½â¾öµô£¬Òò´ËËüµÄËùÓÐÄ£¿é£¨»òÕß·ÖÖ§£©ÆäʵÕë¶Ô¶ÀÁ¢µÄÎÊÌ⣬ÕâÑùÎÒÃǶÔÕâЩÎÊÌâÈôÓÐʲô¸üºÃµÄ½â¾ö·½·¨£¬Ìæ»»ÏàÓ¦µÄÄ£¿é±ãÊÇ£¬Òª²»´úÂë»ìÔÓÔÚÒ»Æðû·¨¿´ÁË¡£ÉÏÒ»²¿·Ö¾ÍÌáµ½ÁË£¬attachEventµÄʼþÁжӳöÁËЩÎÊÌ⣬ÎÒÃÇÒªÊÖ¶¯¹¹½¨ÁжÓÁË¡£ËùνÁжӾÍÊÇÓÐÏÈÓкóµÄÎÊÌâ£¬Ò ......
ÔÚ×öÒ»¸ö×÷ҵʱµ÷ÓÃÍⲿµÄjavascriptÎļþÖеÄÖÐÎÄÐÅϢʱÏÔʾÂÒÂë¡£
ÔÚÉùÃ÷µ÷ÓÃjsµÄ±êÇ©ÖмÓÈëcharset="gb2312"¡£
È磺
<script type="text/javascript" src="check.js" charset="gb2312" > </script> ......