JavaScriptÖÐ×Ô¶¨Òå¶ÔÏóµÄÏà¹Ø֪ʶ
Ò»¸ÅÊö
ÔÚJavaÓïÑÔÖУ¬ÎÒÃÇ¿ÉÒÔ¶¨Òå×Ô¼ºµÄÀ࣬²¢¸ù¾ÝÕâЩÀà´´½¨¶ÔÏóÀ´Ê¹Óã¬ÔÚJavascriptÖУ¬ÎÒÃÇÒ²¿ÉÒÔ¶¨Òå×Ô¼ºµÄÀ࣬ÀýÈ綨ÒåUserÀà¡¢HashtableÀàµÈµÈ¡£
Ä¿Ç°ÔÚJavascriptÖУ¬ÒѾ´æÔÚһЩ±ê×¼µÄÀ࣬ÀýÈçDate¡¢Array¡¢RegExp¡¢String¡¢Math¡¢NumberµÈµÈ£¬ÕâΪÎÒÃDZà³ÌÌṩÁËÐí¶à·½±ã¡£µ«¶ÔÓÚ¸´ÔӵĿͻ§¶Ë³ÌÐò¶øÑÔ£¬ÕâЩ»¹Ô¶Ô¶²»¹»¡£
ÓëJava²»Í¬£¬Java2Ìṩ¸øÎÒÃǵıê×¼ÀàºÜ¶à£¬»ù±¾ÉÏÂú×ãÁËÎÒÃǵıà³ÌÐèÇ󣬵«ÊÇJavascriptÌṩµÄ±ê×¼ÀàºÜÉÙ£¬Ðí¶à±à³ÌÐèÇóÐèÒªÎÒÃÇ×Ô¼ºÈ¥ÊµÏÖ£¬ÀýÈçJavascriptûÓйþÎ÷±íHashtable£¬ÕâÑùµÄ»°ÔÚ´¦Àí¼üÖµ·½Ãæ¾ÍºÜ²»·½±ã¡£
Òò´Ë£¬ÎÒ¸öÈËÈÏΪһ¸öÍêÕûµÄJavascript¶ÔÏóÊÓͼӦ¸ÃÈçÏ£º
¶þ£¬»ù±¾¸ÅÄî
1£¬×Ô¶¨Òå¶ÔÏó¡£
¸ù¾ÝJSµÄ¶ÔÏóÀ©Õ¹»úÖÆ£¬Óû§¿ÉÒÔ×Ô¶¨ÒåJS¶ÔÏó£¬ÕâÓëJavaÓïÑÔÓÐÀàËƵĵط½¡£
Óë×Ô¶¨Òå¶ÔÏóÏà¶ÔÓ¦µÄÊÇJS±ê×¼¶ÔÏó£¬ÀýÈçDate¡¢Array¡¢MathµÈµÈ¡£
2£¬ÔÐÍ£¨prototype£©
ÔÚJSÖУ¬ÕâÊÇÒ»ÖÖ´´½¨¶ÔÏóÊôÐԺͷ½·¨µÄ·½Ê½£¬Í¨¹ýprototype¿ÉÒÔΪ¶ÔÏóÌí¼ÓеÄÊôÐԺͷ½·¨¡£
ͨ¹ýprototypeÎÒÃÇ¿ÉÒÔΪJS±ê×¼¶ÔÏóÌí¼ÓеÄÊôÐԺͷ½·¨£¬ÀýÈç¶ÔÓÚString¶ÔÏó£¬ÎÒÃÇ¿ÉÒÔΪÆäÌí¼ÓÒ»¸öеķ½·¨trim£¨£©¡£
ÓëÑϸñµÄ±à³ÌÓïÑÔ£¨ÀýÈçJava£©²»Í¬£¬ÎÒÃÇ¿ÉÒÔÔÚÔËÐÐÆÚ¼äΪJS¶ÔÏó¶¯Ì¬Ìí¼ÓеÄÊôÐÔ¡£
Èý£¬Óï·¨¹æÔò
1£¬¶ÔÏó´´½¨·½Ê½
1£©¶ÔÏó³õʼ»¯Æ÷·½Ê½
¸ñʽ£ºobjectName = {property1:value1, property2:value2,..., propertyN:valueN}
propertyÊǶÔÏóµÄÊôÐÔ
valueÔòÊǶÔÏóµÄÖµ£¬Öµ¿ÉÒÔÊÇ×Ö·û´®¡¢Êý×Ö»ò¶ÔÏóÈýÕßÖ®Ò»
ÀýÈ磺
var user={name:“user1”,age:18}£»
var user={name:“user1”,job:{salary:3000,title:”programmer“}};
·ÃÎÊ·½Ê½£º
alert(user.job.salary); //output: 3000;
ÒÔÕâÖÖ·½Ê½Ò²¿ÉÒÔ³õʼ»¯¶ÔÏóµÄ·½·¨£¬ÀýÈ磺
var user={name:“user1”,age:18,getName:function(){
return this.name;
}
}
ºóÃ潫ÒÔ¹¹Ô캯Êý·½Ê½ÎªÖصã½øÐн²½â£¬°üÀ¨ÊôÐԺͷ½·¨µÄ¶¨ÒåµÈµÈ£¬Ò²Õë¶Ô¹¹Ô캯ÊýµÄ·½Ê½½øÐн²½â¡£
2£©¹¹Ô캯Êý·½Ê½
±
Ïà¹ØÎĵµ£º
ÎÊ£º
1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
ÎÊÌâ1´ð°¸ÈçÏ£º
javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
·½·¨Ò»£º1¡¢Ê×ÏȽ¨Á¢Ò»¸ö°´Å¥£¬ÔÚºǫ́½«µ÷Óûò´¦ÀíµÄÄÚÈÝдÈëbutton_clickÖÐ;
2¡¢ÔÚǰ̨дһ¸öjsº¯Êý£¬ÄÚÈÝΪ ......
HtmlÒ³
<a href="javascript:void(0);" ><img id="SubmitFeedback" src="/images/comment_btn.gif" /></a>
½Å±¾
$(document).ready(function() {
alert("Ò³ÃæË¢ÐÂ");
$("#SubmitFeedback").bind("click", Test);
});
functi ......
¿Í»§¶Ë½Å±¾JavaScriptÔÚд·¨ÉÏÆäʵÓкܶàÖÖ·½·¨£¬ËüÃǵķÅÖÃλÖÃÒ²·Ç³£Ö®¶à¡£¡£
ÏÂÃæÁоÙÔÚÈýÖÖ²»Í¬µÄµØ·½Ð´JavaScript´úÂ룬ʵÏÖµÄЧ¹û¶¼Êǵã»÷°´Å¥buttonµ¯³öalert¾¯¸æ¿ò
µÚÒ»ÖÖÊÇ×î³£¼ûµÄ£¬´úÂëÈçÏÂ
html´úÂë
<input type="button" value="°´Å¥1" id="btn1" onclick="pop()">
js´úÂë
f ......
Çø·ÖXHTMLÓëHTMLµÄ±êÖ¾£º
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
Ç°ÕßÊÇXHTML£¬ºóÕßÊÇHTML
ä¯ÀÀÆ÷µÄ¸ßºÍ¿í£º
XHTML£º
document.document ......
´ò¿ªÒ»¸ö js Îļþ£¬±à¼Íê³É±£´æʱ£¬Í»È»ÌáÐÑÏÂÃæµÄ´íÎó£º
Save could not be completed.
Reason:
Some characters cannot be mapped using “ISO-8859-1″ character encoding. Either change the encoding or remove the characters which are not supported by the “ISO-8859-1″ character ......