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

javascript ×Ö·û´®´¦ÀíÈ«¹¥ÂÔ


ÎÄÕ·ÖÀࣺ
JavaScript
ÎÄÕ±êÌ⣺
javascript ×Ö·û´®´¦ÀíÈ«¹¥ÂÔ
¹Ø  ¼ü ×Ö£º
0
ÎÄÕÂ×÷Õߣº
alonglee
ÎÄÕÂÀ´Ô´£º
http://lmgq.vip.sina.com/tech/jsadvancedlesson/c2p1.htm

·¢±íʱ¼ä£º
2004-9-21 14:43:00


Ò»¡¢ÉùÃ÷×Ö·û´®:
var normal_monkey = "I am a monkey!<br>";
document.writeln("Normal monkey " + normal_monkey);
var bold_monkey = normal_monkey.bold();
document.writeln("Bold monkey " + bold_monkey);
ÕâÀïµÄÉùÃ÷£º var bold_monkey = normal_monkey.bold();
ºÍÏÂÃæ¶ÔÉùÃ÷ÊǵÈͬµÄ£º 
var bold_monkey = "<b>" + normal_monkey + "</b>";
µÚ1¸ö°æ±¾µÄÉùÃ÷¿´ÆðÀ´Òª¼òÃ÷µÃ¶à¡£ÕâÀïÓõ½ÁË×Ö·û´®¶ÔÏóÖÐ
µÄbold¶ÔÏ󣬯äËûµÄ×Ö·û´®¶ÔÏó»¹ÓÐindexOf, charAt, 
substring, ÒÔ¼°split, ÕâЩ·½·¨¿ÉÒÔÉîÈë×Ö·û´®µÄ×é³É½á¹¹¡£
Ê×ÏÈÎÒÃÇÑо¿Ò»ÏÂindexOf¡£
2¡¢indexOf
indexOfÓÃÓÚ·¢ÏÖһϵÁеÄ×Ö·ûÔÚÒ»¸ö×Ö·û´®ÖеÈλÖò¢¸æËßÄã×Ó×Ö·û´®µÄÆðʼλÖá£Èç
¹ûÒ»¸ö×Ö·û´®Öв¿°üº¬¸Ã×Ó×Ö·û´®ÔòindexOf·µ»Øreturns "-1."
Àý×Ó£º
var the_word = "monkey"; 
 //ÈÃÎÒÃÇ´Óµ¥´Ê "monkey"¿ªÊ¼¡£ 
var location_of_m = the_word.indexOf("m"); 
 //location_of_m(×ÖĸmµÄλÖÃ)½«Îª0£¬ÒòΪ×ÖĸmλÓÚ¸Ã×Ö·û´®µÄÆðʼλÖá£
var location_of_o = the_word.indexOf("o"); 
 //location_of_o(×ÖĸoµÄλÖÃ)½«Îª1¡£
var location_of_key = the_word.indexOf("key"); 
 //location_of_key(keyµÄλÖÃ)½«Îª3ÒòΪ×Ó×Ö·û´®“key”ÒÔ×Öĸk¿ªÊ¼£¬¶øk
ÔÚµ¥´ÊmonkeyÖеÄλÖÃÊÇ3¡£
var location_of_y = the_word.indexOf("y"); 
 //location_of_y)×ÖĸyµÄλÖÃ)ÊÇ5¡£ 
var cheeky = the_word.indexOf("q"); 
 //cheekyÖµÊÇ-1£¬ÒòΪÔÚµ¥´Ê“monk


Ïà¹ØÎĵµ£º

JavaScript »ñÈ¡¶ÔÏóµÄ¸ß¶ÈºÍ¿í¶ÈÏêϸ˵Ã÷

scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐĿǰ¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×î¶¥¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×î¶¥¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......

javascriptÃæÏò¶ÔÏóÈ«ÐÂÀíÁ·(ËÄ)

ÀûÓÃÔ­Ðͼ̳еĹؼüÓÐÁ½²½²Ù×÷£º
Ê×ÏÈ´´½¨Ò»¸ö¸¸ÀàµÄʵÀý»¯¶ÔÏó£¬È»ºó½«¸Ã¶ÔÏ󸳸ø×ÓÀàµÄ prototype ÊôÐÔ¡£
ÕâÑù£¬¸¸ÀàÖеÄËùÓй«ÓÐʵÀý³ÉÔ±¶¼»á±»×ÓÀà¼Ì³Ð¡£²¢ÇÒÓà instanceof ÔËËã·ûÅжÏʱ£¬×ÓÀàµÄʵÀý»¯¶ÔÏó¼ÈÊôÓÚ×ÓÀ࣬ҲÊôÓÚ¸¸Àà¡£
È»ºó½«×ÓÀà±¾Éí¸³Öµ¸øËüµÄ prototype µÄ constructor ÊôÐÔ¡££¨×¢Ò⣺ÕâÀ︳ֵµÄʱº ......

JavaScript ºÍJSP Á¬½ÓSqlServer Êý¾Ý¿â

µÚÒ»ÖÖ JavaScriptÁ¬½ÓÊý¾Ý¿â£º
<mce:script language="JavaScript"><!--
// ´´½¨Êý¾Ý¿â¶ÔÏó
var objdbConn = new ActiveXObject("ADODB.Connection");
// DSN×Ö·û´®
var strdsn = "Driver={SQL Server};SERVER=192.168.0.210;UID=xhb;PWD=xhb;DATABASE=books";
// ´ò¿ªÊý¾ÝÔ´
objdbConn.Open(strdsn);
// ......

JavaScript »ñÈ¡¿Í»§¶Ë¼ÆËã»úÓ²¼þ¼°ÏµÍ³ÐÅÏ¢


//ϵͳÐÅÏ¢»ñÈ¡
function getSysInfo(){
var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
//CPUÐÅÏ¢
var cpu = new Enumerator (service.ExecQuery("SELECT * from Win32_Processor")).item();
var cpuType=cpu.Name,h ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ