Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JS(javascript)²Ù×÷Êý¾Ý¿â

//°ÑÊý¾ÝдÈëÊý¾Ý¿â
function
res(){
    //»ñÈ¡ÊäÈëÖµ(mynameºÍmymailÊÇÁ½¸öÎı¾¿òµÄid)
    var
uname = document.getElementById("myname"
).value;
    var
umail = document.getElementById("mymail"
).value;

    //Êý¾Ý¿âÁ¬½Ó¶ÔÏó
    var
con = new
ActiveXObject("ADODB.Connection"
);
    //Á¬½Ó×Ö·û´®
    var
str = "DRIVER={SQL SERVER}
;SERVER=(local);uid=sa;pwd=123456;database=xslt"
;
    //´ò¿ªÊý¾ÝÔ´
    con.Open(str);
    //sqlÓï¾ä
    var
sql = "insert into xslt(name,mail) values('"
+ uname + "','"
+ umail + "')"
;
    try
{
        //Ö´ÐÐsqlÓï¾ä
        con.Execute(sql);
        //¹Ø±ÕÁ¬½Ó
        con.Close();
        //תÏò³É¹¦Ò³Ãæ
        window.location.href = "http://www.aspxcs.net/";
    }

    catch
(e){
        alert(e);
    }



Ïà¹ØÎĵµ£º

Ò»¾ä»°JavaScript±íµ¥ÑéÖ¤´úÂë

±íµ¥µÄ¿Í»§¶ËjavascriptÑéÖ¤Óи÷ÖÖ¸÷ÑùµÄд·¨£¬µÇ¼ΪformµÄonsubmitʼþ»òsubmit°´Å¤Ð´Ò»¸öº¯Êý¡£¶ÔÓÚС±íµ¥£¨Ö»ÓÐÒ»Á½¸ö±íµ¥ÓòµÄ±íµ¥£©¾Í²»±ØÔÙרÃÅÔÙÓÃjavascriptдһ¸öÑéÖ¤º¯ÊýÁË£¬Ö»ÐèÒªÔÚformµÄonsubmitʼþÀï¼ÓÉÏ£º
onsubmit=”return domainname.value==”?(alert(’ÇëÊäÈëËÑË÷ÄÚÈÝ’),false ......

javascriptÖÐloose typeµÄÓ°Ïì


var obj = new Object();
obj.name = "hello";
obj['name'] = "world";
alert(obj.name);
±»ÈËÎʵ½ÕâÑùÒ»¶Î´úÂ룬alertµÄ½á¹ûÓ¦¸ÃÊÇʲôÄØ£¿
Îһشð£ºhello #½á¹û´ó´íÌØ´í£¡
Ó¦¸ÃÊÇ“world”£¡£¡£¡
ÒòΪjsÊÇÒ»ÖÖËÉÉ¢ÀàÐ͵ÄÓïÑÔ£¬objËäÈ»±»ÉùÃ÷ÊÇÒ»¸ö¶ÔÏ󣬵«ÊÇ°ÑËüµ±³ÉÊý×éÀ´·ÃÎÊҲûʲô²»¿ÉÒÔ¡£
ËäÈ» ......

javascript refresh page ¼¸ÖÖÒ³Ãæˢеķ½·¨

JavascriptË¢ÐÂÒ³ÃæµÄ¼¸ÖÖ·½·¨£º
1    history.go(0)
2    location.reload()
3    location=location
4    location.assign(location)
5    document.execCommand('Refresh')
6    window.navigate(location)
7& ......

JavaScript isNaN() º¯Êý


·µ»Ø JavaScript È«¾Ö¶ÔÏó²Î¿¼ÊÖ²á
¶¨ÒåºÍÓ÷¨
isNaN() º¯ÊýÓÃÓÚ¼ì²éÆä²ÎÊýÊÇ·ñÊÇ·ÇÊý×ÖÖµ¡£
Óï·¨
isNaN(x)
²ÎÊýÃèÊö
x
±ØÐè¡£Òª¼ì²âµÄÖµ¡£
·µ»ØÖµ
Èç¹û x ÊÇÌØÊâµÄ·ÇÊý×ÖÖµ NaN£¨»òÕßÄܱ»×ª»»ÎªÕâÑùµÄÖµ£©£¬·µ»ØµÄÖµ¾ÍÊÇ true¡£Èç¹û x ÊÇÆäËûÖµ,Ôò·µ»Ø false¡£
˵Ã÷
isNaN() º¯Êý¿ÉÓÃÓÚÅжÏÆä²ÎÊýÊÇ·ñÊÇ NaN£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ