Javascript Êý×éѧϰһÔò
1. Ó¦Óà Array.prototype.joinʵÏÖ×Ö·ûºÏ²¢
·½·¨1.
String.prototype.times = function(n) {
return Array.prototype.join.call({length:n+1}, this);
};
"js".times(5) // => "jsjsjsjsjs"
·½·¨2.
var ArrayTest=new Array("HE","LL","O");
var hello = Array.prototype.join.call(ArrayTest, '|');
alert(hello); // => "HE|LL|O");
2.×Ö·û´®·Ö¸î³ÉÊý×é
var _param = "HE||LL||O";
var _paramArray = _param.split("|");
alert(_paramArray.length)
Ïà¹ØÎĵµ£º
ClosureÖÐÎÄ·ÒëΪ±Õ°ü.×ÖÃæÉÏÀ´Àí½â¾ÍÊÇ"·â±ÕµÄ°ü".(ÕâÊÇÒ»¾ä·Ï»°)
±Õ°üÊÇʲô?
ÊéÃæ½âÊÍΪ: Ëùν“±Õ°ü”£¬Ö¸µÄÊÇÒ»¸öÓµÓÐÐí¶à±äÁ¿ºÍ°ó¶¨ÁËÕâЩ±äÁ¿µÄ»·¾³µÄ±í´ïʽ£¨Í¨³£ÊÇÒ»¸öº¯Êý£©£¬Òò¶øÕâЩ±äÁ¿Ò²ÊǸñí´ïʽµÄÒ»²¿·Ö¡£
ÎÒÈÏΪ±Õ°ü¾ÍÊÇÄܹ»¶Á/дº¯ÊýÄÚ²¿µÄijЩ±äÁ¿µÄ×Óº¯Êý,²¢½«ÕâЩ±äÁ¿±£´æÔÚÄÚ´æÖÐ.
± ......
//»ñÈ¡µ±Ç°Îļþȫ·¾¶
<script language="javascript">
alert(window.location.href);
alert(window.location);
alert(location.href);
alert(parent.location.href);
alert(top.location.href);
alert(document.location.href);
alert(document.URL);
</scri ......
Evaluates an expression after a specified number of milliseconds has elapsed.
(ÔÚÖ¸¶¨Ê±¼ä¹ýºóÖ´ÐÐÖ¸¶¨µÄ±í´ïʽ)
Syntax:
iTimerID = window.setTimeout(vCode, iMilliSeconds [, sLanguage])
Parameters
vCode
Required. Variant that specifies the function pointer or string that indicates the code to be ......
×Ô´Ó Google ÍÆ³öº¬ V8 JavaScript ÒýÇæµÄ Chrome ÒÔÀ´£¬¹«ÖÚ¶Ô JavaScript
ÒýÇæÖ´ÐÐЧÂʵÄθ¿ÚÓÖÒ»´Î±»Ìá¸ß£¬ÖÚ¶àä¯ÀÀÆ÷µÄ¿ª·¢ÕßÃǽʾ¡ÄÔÖÌáÉýËûÃÇµÄ JavaScript ÐÔÄÜ£¬Opera ×îеÄ10.50 °æµÄ Carakan
ÒýÇæ¾Ý³ÆÒѾ³¬¹ý V8£¬¶ø Firefox µÄ¿ª·¢ÕßÃÇÒ²²»¸ÊʾÈõ¡£
×î½üÉý¼¶µ½ Firefox 3.6 µÄÓû§ÒѾ·¢ÏÖËûÃÇµÄ Java ......
<script>
var i = 0;
function insertTr(obj)
{
var tr1 = tb.insertRow(obj.rowIndex+1);
  ......