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;
&
Ïà¹ØÎĵµ£º
1ÅжÏselectÑ¡ÏîÖÐ ÊÇ·ñ´æÔÚValue="paraValue"µÄItem
2ÏòselectÑ¡ÏîÖÐ ¼ÓÈëÒ»¸öItem
3´ÓselectÑ¡ÏîÖРɾ³ýÒ»¸öItem
4ɾ³ýselectÖÐÑ¡ÖеÄÏî
5ÐÞ¸ÄselectÑ¡ÏîÖÐ value="paraValue"µÄtextΪ"paraText"
6ÉèÖÃselectÖÐtext="paraText"µÄµÚÒ»¸öItemΪѡÖÐ
7ÉèÖÃselectÖÐvalue="paraValue"µÄItemΪѡÖÐ
8µÃµ½selectµ ......
javascript»ñµÃÑ¡ÖÐÐÅÏ¢
filed in javascript post by onelong on2009-12-18 13:57 Friday
×î½üä¯ÀÀ±ðÈ˵IJ©¿Íʱ,¿´µ½±ðÈ˵Ļ®´ÊËÑË÷ºÜ¿É°®£¡Í»È»Áé»úÒ»¶¯£¬ÎÒÏëËûÊÇÔõÑù»ñÈ¡ÎÒÃǵÄÑ¡ÖеÄÎÄ×ÖÄØ£¿ÕâÑùµÄjavascript½»»¥ÕæµÄºÜÈËÐÔ»¯£¡
µ±È»»ñÈ¡Ò³ÃæÑ¡ÖеÄÄÚÈÝÔÚhtml±à¼Æ÷Ò²ÊǺܳ£Óõģ¡ÈçÒªÐÞ¸ÄijЩ×ÖÌ壬¾Í¿ÉÒÔÏÈÑ¡Ö ......
ÕâÊÇÒ»¸öºÜÌØÊâµÄʼþ£¬w3cĬÈÏÊdzÐÈÏΪ¡°mousewheel¡±£¬µ«ÎÒÔÚËüÉÏÃæÕÒµ½µÄ×ÊÁϱȽÏÉÙ£¬Ö»·¢ÏÖÒ»¸ö¡£ºÅ³Æ×î±ê×¼µÄFF£¬ÓÃÒ»¸ö˽ÓÐʵÏÖDOMMouseScroll¡£×Ü֮ʵÏֺܻìÂÒ¡£ÎÒÃÇÏÈ¿´¸÷ä¯ÀÀÆ÷¶ÔËüµÄÖ§³Ö³Ì¶È°É¡£
IEfirefoxsafari ......
JavaScript²¶»ñ´°¿Ú¹Ø±Õʼþ
¹Ø¼ü×Ö: window.closeʼþ
javascript²¶»ñ´°¿Ú¹Ø±ÕʼþÓÐÁ½ÖÖ·½·¨
1.ÓÃjavascriptÖØÐ¶¨Òå window.onbeforeunload() ʼþ
ÔÚjavascriptÀﶨÒåÒ»¸öº¯Êý¼´¿É
function window.onbeforeunload() { alert("¹Ø±Õ´°¿Ú")}
alert()ʼþ½«»áÔڹرմ°¿ÚǰִÐУ¬ÄãÒ²¿ÉÒÔÓà ......