Javascript¼òÒ×¼ÆÊ±Æ÷£¨ÓÃÀ´¼ÇËã´úÂëµÄÖ´ÐÐʱ¼ä£©
×Ô¼ºÐ´µÄÒ»¸ö¼òÒ×¼ÆÊ±Æ÷£¬ÄܼÇËã´úÂëµÄÖ´ÐÐʱ¼ä£¬»¹¿ÉÒÔÄÃÀ´²âÊÔ´úÂëµÄÖ´ÐÐЧÂÊ¡£
function Counter(){
this.start();
}
Counter.prototype.getTime = function(){
var time = new Date();
return time.getSeconds()*1000+time.getMilliseconds();
}
Counter.prototype.start = function(){
this.counting = true;
this.startTime = this.getTime();
}
Counter.prototype.stop = function(){
if(this.counting == true){
this.counting = false;
this.stopTime = this.getTime();
}
}
Counter.prototype.show = function(){
this.counting==true && this.stop();
this.time = this.stopTime-this.startTime;
document.write('Ö´ÐдúÂ뻨·ÑÁË '+this.time+' ºÁÃë<br>');
this.start();
}
ʹÓÃʾÀýÈçÏ£º
var myCounter = new Counter();
for(var i=0;i<500;i++){
document.write('|');
}
myCounter.show();
var myCounter2 = new Counter();
document.write('<br>');
myCounter2.start(); //ÖØÐ¿ªÊ¼¼ÆÊ±
for(var i=0;i<500;i++){
document.write('*');
}
myCounter2.stop(); //Í£Ö¹¼ÆÊ±
for(var i=0;i<500;i++){
document.write(';');
}
myCounter2.show(); //ÕâÀïÏÔʾµÄʱ¼äÊÇÖ´ÐеÚÒ»´ÎforÑ»·ËùÓõÄʱ¼ä(¾ÍÊÇÊä³öÒ»ÅÅ*µÄÄǸö)
ÔÚ´´½¨¶ÔÏóºó»á×Ô¶¯¿ªÊ¼¼ÆÊ±¡£
µ÷ÓöÔÏóµÄstart()·½·¨½«ÖØÐ¿ªÊ¼¼ÆÊ±¡£
µ÷ÓÃstop()·½·¨»áÍ£Ö¹¼ÆÊ±¡£
show()·½·¨ÓÃÀ´ÏÔʾ´úÂëÖ´ÐеÄʱ¼ä£¨Èç¹ûµ÷ÓÃshow()·½·¨Ç°Ã»Óе÷Óùýstop()£¬»á×Ô¶¯µ÷ÓÃÒ»´Î£©
¶à¸ö¼ÆÊ±¶ÔÏóÖ®¼ä»¥²»Ó°Ïì¡£
ÒòΪÎÒ»¹ÊǸö²ËÄñ£¬Ï£Íû´ó¼Ò¶ÔÎҵIJ»×ãÖ®´¦µãÆÀÖ¸Õý£¡
Ïà¹ØÎĵµ£º
YUI Compressor ѹËõ JavaScript µÄÄÚÈݰüÀ¨£º
ÒÆ³ý×¢ÊÍ
ÒÆ³ý¶îÍâµÄ¿Õ¸ñ
ϸ΢ÓÅ»¯
±êʶ·ûÌæ»»£¨Identifier Replacement£©
YUI Compressor °üÀ¨ÄÄЩϸ΢ÓÅ»¯ÄØ£¿
object["property"] £¬Èç¹ûÊôÐÔÃûÊǺϷ¨µÄ JavaScript ±êʶ·û£¨×¢£ººÏ·¨µÄ JavaScript ±êʶ·û——ÓÉÒ»¸ö×Öĸ¿ªÍ·£¬ÆäºóÑ¡ÔñÐԵؼÓÉÏÒ»¸ö»òÕ ......
window
window¶ÔÏóÊÇä¯ÀÀÆ÷»òÕß¿ò¼Ü×ÔÉí.top×ÜÊÇä¯ÀÀÆ÷,parentÊǸ¸¿ò¼Ü,self±íʾ×Ô¼º.
windowͨ³£¿ÉÒÔÊ¡ÂÔ.
´°¿Ú²Ù×÷: moveBy(dx, dy), moveTo(x, y),
resizeBy(dw, dh), resizeTo(w, h).
µ¼º½: window.open(url, frame
name, attribute). attribute¿ÉÒÔÊÇleft, top, height, width, resizable,
scrollable, too ......
<iframe width='100%' height='100%' name='boot' id='boot' src='' frameborder='0' scrolling='no'></iframe>
<SCRIPT LANGUAGE="JavaScript">
<!--
var iframe = window.frames['boot'];
iframe.document.open();
iframe.document.write('<!DOCTY ......
ÔÚjavascript´úÂëÖÐÓÃencodeURIComponent()º¯Êý´¦ÀíÖÐÎÄ×Ö·û´®£¬
JS´úÂ룺
<mce:script type=”text/javascript”><!--
string = encodeURIComponent(string);
location.href = index.php?keyword=’+string;
// --></mce:script>
PHP´úÂë:
<?php
$keyword = (isset($_GET ......
ÏÈÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó£º
ÏÂÃæÒÔÈý¸öÒ³Ãæ·Ö±ðÃüÃûΪframe.html¡¢top.html¡¢bottom.htmlΪÀýÀ´¾ßÌå˵Ã÷ÈçºÎ×ö¡£
Java´úÂë
frame.html ÓÉÉÏ(top.html)ÏÂ(bottom.html)Á½¸öÒ³Ãæ×é³É£¬´úÂëÈçÏ£º
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ......