[¶ÁÊé±Ê¼Ç][JavaScript¸ß¼¶³ÌÐòÉè¼Æ]
µÚ¶þÕ£ºECMAScript»ù´¡
1.µ±º¯ÊýÎÞÃ÷È··µ»Øֵʱ£¬·µ»ØµÄÒ²ÊÇÖµundefined
function testFunc(){}
alert(testFunc()==undefined);
2.typeof(null)=='object' //true,null¿ÉÒÔ½âÊÍΪ¶ÔÏóռλ·û
3.undefined ÊÇÉùÃ÷Á˱äÁ¿µ«Î´¶ÔÆä³õʼ»¯Ê±¸³Óè¸Ã±äÁ¿µÄÖµ£¬nullÔòÓÃÓÚ±íʾÉÐδ´æÔڵĶÔÏó¡£
alert(null==undefined);//true£¬ÒòΪundefinedÊÇ´ÓÖµnullÅÉÉúÀ´µÄ
4.var num=3.12e3//3.12*10*10*10
var num=3.12-e3//0.00312
5.¹ØÓÚjs±Õ°ü£¬¼òµ¥½âÊÍÊǺ¯Êýµ÷Óú¯ÊýÒÔÍâ±äÁ¿µÄÏÖÏó¡£
var baseNum = 10;
function addNumber(num1,num2){
function doAddition(){
return num1+num2+baseNum;//ÕâÀïµÄnum1¡¢num2¡¢baseNum±äÁ¿¶¼ÊÇ´Óº¯ÊýdoAdditionÍⲿ»ñÈ¡µÄ¡£
}
return doAddition();
}
µÚÈýÕ£º¶ÔÏó»ù´¡
1.ECMA°Ñ¶ÔÏó(object)¶¨ÒåΪ“ÊôÐÔµÄÎÞÐò¼¯ºÏ£¬Ã¿¸öÊôÐÔ´æ·ÅÒ»¸öÔʼֵ¡¢¶ÔÏó»òº¯Êý”£¬»òÕß˵¶ÔÏóÊÇÎÞÌض¨Ë³ÐòµÄÖµµÄÊý×é¡£
2.¶ÔÏó¶¨Òå´æ·ÅÔÚ¹¹Ô캯ÊýÖС£
3.¶ÔÏóµÄ¹¹³É
¶ÔÏóÓÉÌØÐÔ(attribute)¹¹³É£¬ÌØÐÔ¿ÉÒÔÊÇÔʼֵ£¬Ò²¿ÉÒÔÊÇÒýÓÃÖµ¡£Èç¹ûÌØÐÔ´æ·ÅµÄÊǺ¯Êý£¬ÔòËü½«±»¿´×÷ÊǶÔÏóµÄ·½·¨(method)£¬·ñÔò¸ÃÌØÐÔ±»¿´×÷ÊôÐÔ(propert).
4.¶ÔÏóµÄ·Ï³ý
var obj={};
obj=null
×¢£º±ØÐ뽫ËùÓжÔÏóÒýÓÃÈ«²¿¸³ÖµÎªnull£¬²ÅÄÜÕæÕý½«¸Ã¶ÔÏó·Ï³ý¡£
5.Array¶ÔÏó³£Ó÷½·¨
var arr=[1,2,'string'];
·½·¨Ãû
²ÎÊý
·µ»ØÖµ
¹¦ÄÜ
concat
4,'hello'
[1,2,'string',4,'hello']
½«4¡¢'hello'¼ÓÈëÊý×é
slice
1,3
[2,3]
·µ»ØµÚ2ÏîÖÁµÚ4ÏîµÄÐÂÊý×飬²»°üÀ¨µÚ4ÏîÊý×é
push
{num:1}
[1,2,'string',{num:1}]
ѹÈëÐÂÏÔÊý×鳤¶È¼Ó1
pop
arr[length-1]
µ¯³ö×îÐÂÏÔÊý×鳤¶È¼õ1
shift
arr[0]
ɾ³ýÊý×éµÚÒ»Ï½«Æä×÷Ϊº¯ÊýÖµ
·µ»Ø
unshift
'black'
['black',1,2,'string']
½«blackÉèΪÊý×éµÚÒ»ÏÆäËûÏîÏòºóÒÆһλ
slice·½·¨£º
6.
Ïà¹ØÎĵµ£º
http://css-tricks.com/creating-a-slick-auto-playing-featured-content-slider/
demo£ºhttp://css-tricks.com/examples/FeaturedContentSlider/
Featured Content Slider Using jQuery
http://demo.webdeveloperplus.com/featured-content-slider/ ......
Ò³ÃæÒ»£º
<html>
<head>
<title> ÑéÖ¤ÓëÌá½»Ò» </title>
<script>
function focusSelect(ID) //µ±ÑéÖ¤²»ÄÜͨ¹ýʱ»ñµÃÑéÖ¤¿Ø¼þµÄ½¹µãºÍÄÚÈÝ
{
document.getElementById(I ......
phpÖеÄevalºÍJavaScriptÖеÄevalÇø±ð£º
Definition and Usage
¶¨ÒåºÍÓ÷¨
The eval() function evaluates a
string as PHP code.
eval()º¯ÊýµÄ×÷ÓÃÊÇ£º·µ»ØÓëPHP´úÂëÏà¶ÔÓ¦µÄ×Ö·û´®¡£
The string
must be valid PHP code and must end with semicolon.
Õâ¸ö×Ö·û´®±ØÐëÊÇÓÐЧµÄPHP´úÂ룬
²¢ÇÒ±ØÐëÒԷֺŽáÊø¡ ......
1. document.formName.item("itemName") ÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃdocument.formName.item("itemName")»òdocument.formName.elements["elementName"];
FirefoxÏÂ,Ö»ÄÜʹÓÃdocument.formName.elements["elementName"].
½â¾ö·½·¨:ͳһʹÓÃdocument.formName.elements["elementName"].
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷:IEÏÂ,¿É ......
1.DOMÊÇÕë¶ÔXMLµÄ»ùÓÚÊ÷µÄAPI¡£Ê¹ÓÃDOM£¬Ö»Ðè½âÎö´úÂëÒ»´ÎÀ´´´½¨Ò»¸öÊ÷µÄÄ£ÐÍ¡£ÔÚÕâ¸ö³õʼ½âÎö¹ý³ÌÖ®ºó£¬XMLÒѾÍêȫͨ¹ýDOMÄ£ÐͱíÏÖ³öÀ´£¬Í¬Ê±Ò²²»ÔÙÐèÒªÔʼµÄ´úÂë¡£
NB
£ºDOMÊÇÓïÑÔÎ޹صÄAPI£¬Ëü²¢²»ÓëJava¡¢JavaScript»òÆäËûÓïÑ԰󶨡£ ......