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;
&
Ïà¹ØÎĵµ£º
ShowModalDialogº¯ÊýµÄ¹¦ÄÜ£º
´ò¿ªÒ»¸ö×Ó´°¿Ú£¬²¢ÇÒ¿ÉÓ븸´°¿ÚÏ໥´«µÝÊý¾Ý£¬ËüÓëwindow.openµÄ×î´óÇø±ð¾ÍÔÚÓÚÓÉShowModalDialog´ò¿ª×Ó´°¿Úºó£¬¸¸´°¿Ú½«²»ÄÜ
²Ù×÷¡£
ʹÓ÷½·¨£º
vReturnValue = window.showModalDialog(sURL [,
vArguments] [, sFeatures])
²ÎÊý˵Ã÷£º
sURL
±ØÑ¡²ÎÊý£¬ÀàÐÍ£º×Ö·û´ ......
javascript»ñµÃÑ¡ÖÐÐÅÏ¢
filed in javascript post by onelong on2009-12-18 13:57 Friday
×î½üä¯ÀÀ±ðÈ˵IJ©¿Íʱ,¿´µ½±ðÈ˵Ļ®´ÊËÑË÷ºÜ¿É°®£¡Í»È»Áé»úÒ»¶¯£¬ÎÒÏëËûÊÇÔõÑù»ñÈ¡ÎÒÃǵÄÑ¡ÖеÄÎÄ×ÖÄØ£¿ÕâÑùµÄjavascript½»»¥ÕæµÄºÜÈËÐÔ»¯£¡
µ±È»»ñÈ¡Ò³ÃæÑ¡ÖеÄÄÚÈÝÔÚhtml±à¼Æ÷Ò²ÊǺܳ£Óõģ¡ÈçÒªÐÞ¸ÄijЩ×ÖÌ壬¾Í¿ÉÒÔÏÈÑ¡Ö ......
±¾ÎÄÒë×Ô£ºhttp://www.codeproject.com/KB/scripting/jsbeginner.aspx
ÔÎÄ£ºJavaScript For Beginners
ÊÊÒ˶ÔÏó£ºJavaScript³õѧÕß¡£
Ŀ¼£º
°üº¬ÓëÒýÈë(Embedding,including)
write ºÍ writeln
Îĵµ¶ÔÏó£¨document object£©
bgColor ºÍ fgColor
ÏûÏ¢¿ò£¨Message Box£©
±äÁ¿£¨Variables ......
ÔÚJavaScriptÖÐ×Ö·û´®×éºÏÏà¼Ó£¬´ó¼ÒÒ»°ãÖ±½ÓÓÃ+Æ´½ÓÆðÀ´.ÀýÈç:
for(i=0; i<len; i++){
if(zdname != ""){
zdname += "#" + trNode.children.item(i).getAttribute("busPath");
}else{
zdname = trNode.children.item(i).getAttribute("busPath");
  ......
JavaScript²¶»ñ´°¿Ú¹Ø±Õʼþ
¹Ø¼ü×Ö: window.closeʼþ
javascript²¶»ñ´°¿Ú¹Ø±ÕʼþÓÐÁ½ÖÖ·½·¨
1.ÓÃjavascriptÖØж¨Òå window.onbeforeunload() ʼþ
ÔÚjavascriptÀﶨÒåÒ»¸öº¯Êý¼´¿É
function window.onbeforeunload() { alert("¹Ø±Õ´°¿Ú")}
alert()ʼþ½«»áÔڹرմ°¿ÚÇ°Ö´ÐУ¬ÄãÒ²¿ÉÒÔÓà ......