JavaScriptËæ»ú±ä»»±í¸ñ±³¾°
s<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ÎÞ±êÌâÎĵµ</title>
</head>
<body>
<table id="pic" cellpadding="0" cellspacing="0" border="1" width="991" height="439" bordercolor="red">
<tr>
<td>picture chanage!</td>
</tr>
</table>
¡¡¡¡<Script Language="JavaScript">
window.onload=function()
{
changePicture();
}
function changePicture(){
¡¡¡¡
¡¡¡¡image = new Array(3); //¶¨ÒåimageΪͼƬÊýÁ¿µÄÊý×é
¡¡¡¡
¡¡¡¡image [0] = '1.jpg' //±³¾°Í¼ÏóµÄ·¾¶
¡¡¡¡
¡¡¡¡image [1] = '2.jpg'
¡¡¡¡
¡¡¡¡image [2] = '3.jpg'
¡¡¡¡
¡¡¡¡image [3] = '4.jpg'
¡¡¡¡
¡¡¡¡number = Math.floor(Math.random() * image.length)+1;
¡¡¡¡
¡¡¡¡document.getElementById('pic').background="images/"+number+".jpg";
¡¡¡¡}
¡¡¡¡</Script>
</body>
</html>
Ïà¹ØÎĵµ£º
Õâƪ¿ªÊ¼»á·ÖÎöÁ÷ÐеÄjs¿â֮дÀ෽ʽ¡£¸÷ÖÖ¿âµÄдÀ෽ʽËäȻǧÆæ°Ù¹Ö£¬µ«ÈÔÈ»ÌÓÀë²»Á˱¾ÖÊ---Óù¹Ô캯ÊýºÍÔÐÍ
À´×é×°Àà¡£
6¡¢Prototype.jsµÄдÀ෽ʽ
//prototype.jsÖеĴúÂë
var Class = {
create: function() {
return function() {
this.initialize.apply(this, arguments);
}
}
}
//¼ò»¯ ......
Do you want an ultra fast web site? Get JSL and optimize your JavaScript loading now!
Imagine there's a 4-lane highway between your web browser and the internet itself. This highway is optimize to let pictures, text, and css fly by. But, when it comes to external scripts, the highway crea ......
1.javascriptÓëHtmlÖеĵ÷ÓÃÎÊÌâ¡£
ÔÚjavascriptÖÐÒªÏë¸ü¸ÄhtmlÖеÄһЩÊôÐÔÖµ£¬ÌرðÊÇÔÚÒ³ÃæÄÚÈݽ϶àʱ£¬Îñ±ØʹÓÃdocument.getElementById(id)µÄ·½Ê½½øÐУ¬·ñÔòjavascript½«²»Äܸü¸ÄÊôÐÔ£¡
2.DateÀà¡£
ÔÚDateÀàÖеÄgetMonth£¨£©µÈ·½·¨·µ»ØֵΪnumber¡£Òò´Ë¿ÉÒÔʹÓÃÊý×é´æ´¢Ô·ÝÐÅÏ¢Èçmonth£½[“1Ô”£¬&ldq ......
ÔÚasp.net開發ÖУ¬經³£會Óõ½áą́ºÍǰ̨µÄ½»»¥£¬¾Í´Ë總結ÁËÒ»點c#ºÍjavascriptÏ໥²Ù×÷µÄ·½·¨
¡¡¡¡1.ÔÚáą́c#´ú碼ÖÐ調ÓÃjacascriptµÄ·½·¨
¡¡¡¡javascript´ú碼£º
¡¡¡¡<script type="text/javascript" language="javascript">
¡¡¡¡function test()
¡ ......