ÓÃJavaScriptдµÄСʱºòÍæµÄƹÅÒÇòСÓÎÏ·
ÓÉÓÚ»ðºüä¯ÀÀÆ÷²»Ö§³Ö“removeNode”º¯Êý£¬ËùÒÔһϴúÂëÖ»Ö§³ÖIE.
<!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>
<title>--ƹÅÒÇò--</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>
.main{
width:690px;
margin:0 auto;
}
#box{
width:680px;
height:340px;
border:1px solid green;
position:relative;
}
.pingpang{
position:absolute;
width:10px;
height:10px;
background-color:red;
overflow:hidden;
}
.pingpangpai{
position:absolute;
width:60px;
height:10px;
background-color:black;
overflow:hidden;
}
#bigin{
margin:0 auto;
margin:10px;
padding:5px;
}
</style>
<script text="text/javascript" language="javascript">
var Px=0,Py=0;//ƹÅÒÊײ¿
var PPx,PPy;//ƹÅÒÅÄ
var Gox=10,Goy=10;
var end=false;//¹ý½ç
var isOver = false;//ÓÎÏ·½áÊø
var score = 0;//·ÖÊý
var isMove = 0;//ƹÅÒÅĿɷñÒÆ¶¯
function $(id){
return document.getElementById(id);
}
window.onload = function(){
Px = Math.round(Math.random()*33)*20;
createPingPang(Px,Py);
createPingPangPai(300,330);
AllDiv = $("box").all.tags("DIV");
AllSpan = $("box").all.tags("SPAN");
$("bigin").attachEvent('onclick',function(){
&n
Ïà¹ØÎĵµ£º
Regular Expression Optimization ÕýÔò±í´ïʽÓÅ»¯
Incautiously crafted regexes can be a major performance bottleneck (the upcoming section, "Runaway Backtracking" on page 91, contains several examples showing how severe this can be), but there is a lot you can do to improve re ......
Splitting Up Tasks ·Ö½âÈÎÎñ
What we typically think of as one task can often be broken down into a series of subtasks. If a single function is taking too long to execute, check to see whether it can be broken down into a series of smaller functions that complete in smaller ......
Data Format Conclusions Êý¾Ý¸ñʽ×ܽá
Favor lightweight formats in general; the best are JSON and a character-delimited custom format. If the data set is large and parse time becomes an issue, use one of these two techniques:
×ܵÄÀ´ËµÔ½ÇáÁ¿¼¶µÄ¸ñʽԽºÃ£¬× ......
µÚ¾ÅÕÂ
Building and Deploying High-Performance JavaScript Applications
´´½¨²¢²¿Êð¸ßÐÔÄÜJavaScriptÓ¦ÓóÌÐò
According to a 2007 study by Yahoo!'s Exceptional Performance team, 40%–60% of Yahoo!'s users have an empty cache experience, and about 20% of all page views are done ......
Working Around Caching Issues ¹ØÓÚ»º´æÎÊÌâ
Adequate cache control can really enhance the user experience, but it has a downside: when revving up your application, you want to make sure your users get the latest version of the static content. This is accomplished by renaming ......