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

javascript object array string converter

 function object2String(obj)
{
var val, output = "";
if (obj)
{
output += "{";
for (var i in obj)
{
val = obj[i];
switch (typeof val)
{
case ("object"):if (val[0]){output += i + ":" + array2String(val) + ",";}else{output += i + ":" + object2String(val) + ",";}break;
case ("string"):output += i + ":'" + encodeURI(val) + "',";break;
default:output += i + ":" + val + ",";
}
}
output = output.substring(0, output.length-1) + "}";
}
return unescape(output);
}
function array2String(array)
{
var output = "";
if (array)
{
output += "[";
for (var i in array)
{
val = array[i];
switch (typeof val)
{
case ("object"):
if (val[0])
{output += array2String(val) + ",";}
else
{output += object2String(val) + ",";}
break;
case ("string"):
output += "'" + encodeURI(val) + "',";
break;
default:
output += val + ",";
}
}
output = output.substring(0, output.length-1) + "]";
}
return unescape(output);
}
function string2Object(string)
{
eval("var result = " + decodeURI(string));return result;
}
function string2Array(string)
{
eval("var result = " + decodeURI(string));return result;
}
 
²âÊÔ´úÂ룺
function coworker(name, age, dept) {this.name = name;this.age = age;this.department = dept;}
var obj = {};
obj.name="detp one";
obj.action="sale";
var kevin = new coworker("Kevin", 28, obj);
var objStr = object2String(kevin);
alert(objStr);

Óõ½µÄ×ÊÁÏ£º
var str="http://hi.baidu.com/bbjjss2008l?country=Öйú&name=jz";
var urlStr=escape(str);
doc


Ïà¹ØÎĵµ£º

JavascriptÖÐ×î³£ÓõÄ55¸ö¾­µä¼¼ÇÉ

 1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)><td>no</table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut="re ......

JavaScriptÖеĹ«ÓгÉÔ±£¬Ë½ÓгÉÔ±ºÍ¾²Ì¬³ÉÔ±

˽ÓгÉÔ±¾ÍÊÇÔÚÀàµÄÄÚ²¿ÊµÏÖÖпÉÒÔ¹²ÏíµÄ³ÉÔ±¡£µ«ÊDz¢²»¶ÔÍ⹫¿ª£¬JavaScriptÖв¢Ã»ÓÐÌØÊâµÄ»úÖÆÀ´¶¨Òå˽ÓгÉÔ±£¬µ«ÊÇ¿ÉÒÔÓÃһЩ¼¼ÇÉÀ´ÊµÏÖÕâ¸ö¹¦ÄÜ¡£Ö÷ÒªÊÇͨ¹ý±äÁ¿µÄ×÷ÓÃÓòÐÔÖÊÀ´ÊµÏֵģ¬ÔÚÒ»¸öº¯ÊýÄÚ²¿¶¨ÒåµÄ±äÁ¿³ÆΪ¾Ö²¿±äÁ¿£¬¸Ã±äÁ¿²»Äܱ»º¯ÊýÍâµÄ³ÌÐòËù·ÃÎÊ£¬¿ÉÒÔ±»º¯ÊýÄÚ²¿¶¨ÒåµÄǶÌ׺¯ÊýËù·ÃÎÊ¡£
ÔÚÀàµÄ¹¹Ô캯ÊýÖÐ ......

JavascriptÖÐ×î³£ÓõÄ55¸ö¾­µä¼¼ÇÉ

 1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)><td>no</table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut="re ......

AJAX¿ò¼Ü/RIA ¹²ÊÕ¼ÁË 57 ¸ö JavaScript ÏîÄ¿


Ajax¿ò¼Ü jQuery
jQueryÊÇÒ»¿îÃâ·ÑÇÒ¿ª·ÅÔ´´úÂëµÄJavaScript´úÂë¿â£¬ÓÉJohn Resig´´½¨¡£ÊÚȨЭÒéΪGPLºÍMITÐí¿É֤˫ЭÒ顣ʾÀý´úÂ룺 $("p.neat").addClass("ohmy").show("slow"); ÌصãÇáÁ¿¼¶¾­GZipѹËõºó´«ÊäµÄ´úÂëÎļþ½ö14KB£¬Î´¾­Ñ¹Ëõ´«Ë͵ĴúÂëÎļþ½ö26KB¡£ jQuery 1.26°æʱ£º µµ°¸µµ°¸ÐÐÊýµµ°¸Size ±¸×¢ jquery-1.2 ......

JavaScript ͼÏñµØͼ

 
ͼÏñµØͼָµÄÊÇ´øÓпɵã»÷ÇøÓòµÄͼÏñ¡£
ʵÀý
¼òµ¥µÄ HTML ͼÏñÓ³Éä
±¾ÀýÑÝʾһ·ùûÓÐÌí¼Ó JavaScript µÄͼÏñÓ³Éä¡£
Ìí¼ÓÁË JavaScript µÄͼÏñÓ³Éä
±¾ÀýÑÝʾһ·ùÌí¼ÓÁË JavaScript µÄͼÏñÓ³É䣬µ±Êó±ê¸¡¶¯ÓÚij¸öÈȵãÉÏʱ£¬»áµ÷Óà JavaScript º¯ÊýÀ´ÏÔʾÈȵãËù¶ÔÓ¦µÄÐÇÇòµÄ¼ò½é¡£
JavaScript ͼÏñµØͼ
ÎÒÃÇÒѾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ