JavaScript ¼¼ÇÉ
JavaScript µÄ³É¹¦ÈÃÈ˽ò½òÀÖµÀ£¬Îª Web ÍøÒ³±àд JavaScript ´úÂëÒѾÊÇËùÓÐ Web
Éè¼ÆʦµÄ»ù±¾¹¦£¬ÕâÃÅÓÐȤµÄÓïÑÔÔ̲Ø×ÅÐí¶à²»ÎªÈËÊìÖªµÄ¶«Î÷£¬¼´Ê¹¶àÄêµÄ JavaScript ³ÌÐòÔ±£¬Ò²Î´ÄÜÍêÈ«³Ô͸¡£±¾ÎÄ´Ó7¸ö·½Ãæ½²Êö
JavaScript ÖÐÄÇЩÄã²»ºÜÊìÖªµ«·Ç³£ÊµÓõļ¼ÇÉ¡£
¼òÂÔÓï¾ä
JavaScript ¿ÉÒÔʹÓüòÂÔÓï¾ä¿ìËÙ´´½¨¶ÔÏóºÍÊý×飬±ÈÈçÏÂÃæµÄ´úÂ룺
¿ÉÒÔʹÓüòÂÔÓï¾äÈçÏ£º
¶ÔÏó car ¾Í´Ë´´½¨£¬²»¹ýÐèÒªÌرð×¢Ò⣬½áÊø»¨À¨ºÅÇ°Ò»¶¨²»Òª¼Ó ";" ·ñÔòÔÚ IE »áÓöµ½ºÜ´óÂé·³¡£
´´½¨Êý×éµÄ´«Í³·½·¨ÊÇ£º
ʹÓüòÂÔÓï¾äÔò£º
ÁíÒ»¸ö¿ÉÒÔʹÓüòÂÔÓï¾äµÄµØ·½ÊÇÌõ¼þÅжÏÓï¾ä£º
¿ÉÒÔ¼òÂÔΪ£º
JSON Êý¾Ý¸ñʽ
JSON
ÊÇ "JavaScript Object Notation"
µÄËõд£¬ÓÉ Douglas Crockford Éè¼Æ£¬JSON ¸Ä±äÁË JavaScript
ÔÚ»º´æ¸´ÔÓÊý¾Ý¸ñʽ·½ÃæµÄÀ§¾³£¬ÈçÏÂÀý£¬¼ÙÈçÄãÒªÃèÊöÒ»¸öÀÖ¶Ó£¬¿ÉÒÔÕâÑùд£º
Äã¿ÉÒÔÔÚ JavaScript ÖÐÖ±½ÓʹÓà JSON£¬ÉõÖÁ×÷ΪijЩ API µÄ·µ»ØÊý¾Ý¶ÔÏó£¬ÒÔÏ´úÂëµ÷ÓÃÖøÃûÊéÇ©ÍøÕ¾ delicious.com
µÄÒ»¸ö
API£¬·µ»ØÄãÔÚ¸ÃÍøÕ¾µÄËùÓÐÊéÇ©£¬²¢ÏÔʾÔÚÄã×Ô¼ºµÄÍøÕ¾£º
JavaScript ±¾µØº¯Êý (Math, Array ºÍ String)
JavaScript ÓкܶàÄÚÖú¯Êý£¬ÓÐЧµÄʹÓ㬿ÉÒÔ±ÜÃâºÜ¶à²»±ØÒªµÄ´úÂ룬±ÈÈ磬´ÓÒ»¸öÊý×éÖÐÕÒ³ö×î´óÖµ£¬´«Í³µÄ·½·¨ÊÇ£º
ʹÓÃÄÚÖú¯Êý¿ÉÒÔ¸üÈÝÒ×ʵÏÖ£º
ÁíÒ»¸ö·½·¨ÊÇʹÓà Math.max() ·½·¨£º
Äã¿ÉÒÔÓÃÕâ¸ö·½·¨°ïÖú̽²âä¯ÀÀÆ÷
Õâ½â¾öÁË IE ä¯ÀÀÆ÷µÄÒ»¸öÎÊÌ⣬ͨ¹ýÕâÖÖ·½·¨£¬Äã×ÜÊÇ¿ÉÒÔÕÒµ½ÄǸöÕýÈ·µÄÖµ£¬ÒòΪä¯ÀÀÆ÷²»Ö§³ÖµÄÄǸöÖµ»á·µ»Ø undefined¡£
»¹¿ÉÒÔʹÓà JavaScript ÄÚÖÃµÄ split() ºÍ join() º¯Êý´¦Àí HTML ¶ÔÏóµÄ CSS ÀàÃû£¬Èç¹û HTML
¶ÔÏóµÄÀàÃûÊÇ¿Õ¸ñ¸ô¿ªµÄ¶à¸öÃû×Ö£¬ÄãÔÚΪËü×·¼Ó»òɾ³ýÒ»¸ö CSS
ÀàÃûµÄʱºòÐèÒªÌرð×¢Ò⣬Èç¹û¸Ã¶ÔÏó»¹Ã»ÓÐÀàÃûÊôÐÔ£¬¿ÉÒÔÖ±½Ó½«ÐµÄÀàÃû¸³ÓèËü£¬Èç¹ûÒѾ´æÔÚÀàÃû£¬ÐÂÔöµÄÀàÃûÇ°±ØÐëÓÐÒ»¸ö¿Õ¸ñ£¬Óô«Í³µÄ
JavaScript ·½·¨ÊÇÕâÑùʵÏֵģº
ʹÓà split ºÍ join ·½·¨ÔòÖ±¹ÛÓÅÑŵöࣺ
ʼþ´úÀí
ÓëÆäÔÚ HTML
ÎĵµÖÐÉè¼ÆÒ»¶Ñʼþ£¬²»ÈçÖ±½ÓÉè¼ÆÒ»¸öʼþ´úÀí£¬¾ÙÀý˵Ã÷£¬¼ÙÈçÄãÓÐһЩÁ´½Ó£¬Óû§µã»÷ºó²»Ïë´ò¿ªÁ´½Ó£¬¶øÊÇÖ´ÐÐij¸öʼþ£¬HTML ´úÂëÈçÏ£º
´«Í³µÄʼþ´¦ÀíÊDZéÀú¸÷¸öÁ´½Ó£¬¼ÓÉϸ÷×ÔµÄʼþ´¦Àí£º
ʹÓÃʼþ´úÀí£¬¿ÉÒÔÖ±½Ó´¦Àí£¬ÎÞÐè±éÀú£º
ÄäÃûº¯ÊýÓë Module ģʽ
JavaScript
µÄÒ»¸öÎÊÌâÊÇ£¬ÈκαäÁ¿£¬º¯Êý»òÊǶÔÏ󣬳ý·ÇÊÇÔÚij¸öº¯ÊýÄÚ²¿¶
Ïà¹ØÎĵµ£º
1.Date
ÊôÐÔ(1):
constructor Ëù½¨Á¢¶ÔÏóµÄº¯Êý²Î¿¼
prototype Äܹ»Îª¶ÔÏó¼ÓÈëµÄÊôÐԺͷ½·¨
·½·¨(43):
getDay() ·µ»ØÒ»ÖÜÖеĵڼ¸Ìì(0-6)
getYear() ·µ»ØÄ ......
Ò».ʹÓÃRegisterStartUpScript×¢²áÖ»Ö´ÐÐÒ»´ÎµÄjavascript
µÚ1²½(´´½¨²¢×¢²á²¢Ê¹ÓÃjavascript)£ºPage.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
//´´½¨JavaScript
string info = "<mce:script type="text/javascript"><!--alert('ÄãºÃ£¬ÎÒÊÇXXX£¡')// --></mce:scrip ......
ÓÃJavascriptʵÏÖ¸ù¾ÝÏÂÀÁбícategoryµÄÑ¡Ôñ½á¹û£¬¸Ä±äÏÂÀÁбísub_categoryµÄÑ¡Ïî
<mce:script language="javascript" type="text/javascript">
<!--
function changeSubCategory() {
var sel_category = document.getElementById("category");
var sel_sub_category = document.getElementById("sub_c ......
ÓÃjs ´ò¿ªÐ´°¿ÚµÄʱºò£¬´°¿Ú×î´ó»¯¡£
function showBigLisence(url){
if(url!== undefined && url!== null && url !== ''){
var scrWidth=screen.availWidth;
var scrHeight=screen.availHeight;
var self=window.open( ......
ÔÚÏßÊÔÍ棺http://asfoxes.w229.7ga.net/js
ÏÂÔصØÖ·£ºhttp://download.csdn.net/source/2235386
֮ǰ»¨ÁËÒ»¸ö½üÒ»¸öÀñ°ÝдµÄ
Ä¿Ç°»ù±¾Íê³ÉÁË£¬¿ÉÒÔÈ¥³¢ÊÔÏÂ
ä¯ÀÀÆ÷°æ±¾£º
IE8Õý³£ÔËÐÐ
op¡¢ff...ÉÐÓÐÒ»¸öСbug£¬²»ÄÜÍêÃÀÔËÐÐ
Ö÷ÒªÓÐÒÔϼ¸¸öÎÊÌâÔÝʱû´¦Àí£º
1.¸ü¼Ó¶àµÄÖ²ÎïºÍ½©Ê¬ÖÖÀàÌí¼Ó
2.Ö²ÎïºÍ½©Ê¬µÄÌùͼ»¹ ......