È¥³ýjavascriptÊý×éÖеÄÏàÍ¬ÔªËØ
<script type="text/javascript">
function uniqueArr(arr)
{
arr = arr || [];
var a = {};
for (var i=0; i<arr.length; i++)
{
var v = arr[i];
if (typeof(a[v]) == 'undefined')
{
a[v] = 1;
}
}
arr.length = 0;
for (var i in a )
{
arr[arr.length] = i;
}
return arr;
}
var ss=new Array();
ss.push("aaaa");
ss.push("bbbb");
ss.push("bbb1b");
ss.push("bbb2b");
if (ss.length == uniqueArr(ss).length){
alert("no reapeat");
}
else{
alert("reapeat!!!");
}
//alert(ss.length);
//alert(uniqueArr(ss).length);
</script>
Ïà¹ØÎĵµ£º
µ¹¼ÆÊ±¼ÆËã
<body>
<div id="countdown"></div>
<mce:script type="text/javascript"><!--
var i = 0;
(function(){
var hour, min, sec, text;
tmp = 12 * 60 * 60 - i;
hour = Math.floor(tmp / 3600);
tm ......
keypressÖ÷ÒªÓÃÀ´½ÓÊÕ×Öĸ¡¢Êý×ÖµÈANSI×Ö·û£¬¶ø keydownºÍ keyupʼþ¹ý³Ì¿ÉÒÔ´¦ÀíÈκβ»±» keypressʶ±ðµÄ»÷¼ü£¬ÖîÈ磺¹¦Äܼü£¨F1-F12£©¡¢±à¼¼ü¡¢¶¨Î»¼üÒÔ¼°ÈκÎÕâЩ¼üºÍ¼üÅÌ»»µµ¼üµÄ×éºÏµÈ¡£Óë
keydownºÍ keyupʼþ²»Í¬µÄÊÇ£¬keypress²»ÏÔʾ¼üÅ̵ÄÎïÀí״̬£¨SHIFT¼ü£©£¬¶øÖ»ÊÇ´«µÝÒ»¸ö×Ö·û¡£keypress½«Ã¿¸ö×Ö·ûµÄ´ó¡¢Ð¡Ð ......
JavaScript ºÍ Flash µÄͨÐÅ
ÏÂÃæÊÇһЩÔÚFlashºÍʹÓÃJavascriptµÄHTMLÎļþÖ±½ÓͨÐŵÄʾÀý,ÿ¸öʾÀý¶¼ÓмòÂԵIJ½Öè
±¾ÎÄÌÖÂÛÁË3ÖÖ»ù±¾µÄFlash/JavascriptͨÐÅ·½Ê½:
Javascript µ½ FlashµÄͨÐÅ----ʹÓÃFlash²¥·ÅÆ÷µÄjavascript·½·¨
Flash µ½ JavascriptµÄͨÐÅ----ʹÓÃFlashµÄfscommand
Flash µ½ FlashµÄͨÐÅ----------Ê ......
ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type
²¶»ñÊÍ·Å
event.srcElement.setCapture();
event.srcElement.releaseCapture();
ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
ʼþ·µ»ØÖµ
event.returnValue
Êó±êλÖÃ
event.x
e ......
ʹÓÃJavaScript¿ÉÒÔ½«Óû§µ¼ÏòÒ»¸öÌØ¶¨µÄµØÖ·£¬²¢ÇÒ²»Í¬µÄ·½·¨»á¶Ôä¯ÀÀÆ÷µÄÀúÊ·¼Ç¼Óв»Í¬µÄÓ°Ïì¡£
ʵÀýJavaScript´úÂë
±¾Àý¶¨ÒåÁËÁ½¸öJavaScriptº¯Êý£¬¹¦Äܶ¼ÊÇÖØ¶¨Ïòµ½Ê×Ò³£¬µ«ÊǵÚÒ»¸öº¯Êý²ÉÓõÄÊÇÖ±½Ó¸øhref¸³ÖµµÄ·½Ê½£¬µÚ¶þ¸öʹÓõÄÊÇreplace·½·¨¡£¾ßÌåÇë¿´ÏÂÃæµÄ´úÂ룺
<script type="text/javascript">
f ......