Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javascriptдcookieµÄһЩ·½·¨

º¯ÊýÒ»¡¢Ð´cookieµÄº¯Êý£¬½«CookieдÈë¿Í»§¶Ë£¬Í¨Óú¯Êý£¬´«Èë3¸ö²ÎÊý¼´¿É£¨CookieÃû×Ö£¬ÖµºÍʧЧÆÚ£©
//º¯Êý£ºÐ´Èëcookie
function WriteCookie (cookieName, cookieValue, expiry)
{
var expDate = new Date();
if(expiry) //Èç¹ûÉèÖÃÁËcookieʧЧʱ¼ä;
{
expDate.setTime (expDate.getTime() expiry);
document.cookie = cookieName "=" escape (cookieValue) "; expires=" expDate.toGMTString();
}
else //ûÓÐÉèÖÃcookieʧЧʱ¼ä;
{
document.cookie = cookieName "=" escape (cookieValue);
}
}
º¯Êý¶þ¡¢È¡µÃ±íµ¥Êý¾Ý
//º¯Êý£ºÈ¡µÃform±íµ¥ÓòµÄÖµ×÷ΪcookieµÄÏà¹ØÖµ£¨cookie name,cookie value,expires£©
function setCookie ()
{
var name = document.myform.text1.value;
var value = document.myform.text2.value;
var num = document.myform.text3.value;
var select = document.myform.text3.selectedIndex;
if (name=="" || value=="" || num==""){
alert ("ÇëÊäÈëCookieµÄÃû×Ö,ÖµºÍʧЧÆÚÔÙ²âÊÔ!");
return false;
}
if(num == 0)
{
WriteCookie(name, value, 0);
}
else if(select == 0)
//Èç¹ûÑ¡ÔñµÄÊÇÌì;ʱ¼ä»»Ëã³ÉÃë;
{
WriteCookie(name, value, 1000 * 60 * 60 * 24 * num);
}
else if(select == 1)
//Èç¹ûÑ¡ÔñµÄÊÇÔÂ;
{
WriteCookie(name, value, 1000 * 60 * 60 * 24 * num * 31);
}
else if(select == 2)
//Èç¹ûÑ¡ÔñµÄÊÇÄê;
{
WriteCookie(name, value, 1000 * 60 * 60 * 24 * num * 365);
}
alert ("CookieÒѾ­±£´æ")
}
º¯ÊýÈý¡¢¶ÁcookieµÄÖµ
function ReadCookie (CookieName) {
var CookieString = document.cookie;
var CookieSet = CookieString.split (';');
var SetSize = CookieSet.length;
var CookiePieces
var ReturnValue = "";
var x = 0;
for (x = 0; ((x < SetSize) && (ReturnValue == "")); x ) {
CookiePieces = CookieSet[x].split ('=');
if (CookiePieces[0].substring (0,1) == ' ') {
CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
}
if (CookiePieces[0] == CookieName) {
ReturnValue = CookiePieces[1];
}
}
alert ("Cookie Value is:" ReturnValue);
}
HTML±íµ¥ÄÚÈÝ£º
<form name=myform>
<table width="95%" border="0" cellspacing="0" cellpadding="2">
&


Ïà¹ØÎĵµ£º

[·­Òë]High Performance JavaScript(033)

Summary  ×ܽá
    When web pages or applications begin to feel slow, analyzing assets as they come over the wire and profiling scripts while they are running allows you to focus your optimization efforts where they are needed most.
    µ±ÍøÒ³»òÓ¦ÓóÌÐò±äÂýʱ£¬·ÖÎ ......

ÓÃ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>
< ......

ÈçºÎÎÒjavaScript»ñÈ¡´°¿ÚµÄ¸ß¶ÈºÍ¿í¶È

ÔÚjavascriptÖеõ½µ±Ç°´°¿ÚµÄ¸ßºÍ¿í
<body><SCRIPT LANGUAGE="JavaScript">
var  s = "";
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clien ......

jLayout — JavaScript Layout Algorithms


The jLayout JavaScript library provides layout algorithms for laying out components. A component is an abstraction; it can be implemented in many ways, for example as items in a HTML5 Canvas drawing or as HTML elements. The jLayout library allows you to focus on drawing the individual components i ......

JavaScriptµÄä¯ÀÀÆ÷¶ÔÏóÏê½â

JavaScriptµÄä¯ÀÀÆ÷¶ÔÏóÏê½â  
Ò»¡¢ä¯ÀÀÆ÷¶ÔÏó²ã´Î¼°ÆäÖ÷Òª×÷ÓÃ
¶þ¡¢Îĵµ¶ÔÏó¹¦Äܼ°Æä×÷Óà
Èý¡¢·¶Àý 
ʹÓÃä¯ÀÀÆ÷µÄÄÚ²¿¶ÔÏóϵͳ, ¿ÉʵÏÖÓëHTMLÎĵµ½øÐн»»¥¡£ËüµÄ×÷ÓÃÊǽ«Ïà¹ØÔªËØ×éÖ¯°ü×°ÆðÀ´£¬Ìṩ¸ø³ÌÐòÉè¼ÆÈËԱʹÓ㬴Ӷø¼õÇá±à³ÌÈ˵ÄÀͶ¯£¬Ìá¸ßÉè¼ÆWebÒ³ÃæµÄÄÜÁ¦¡£
Ò»¡¢ä¯ÀÀÆ÷¶ÔÏó²ã´Î¼°ÆäÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ