javascript ½á¹¹ÌåʾÀý
<script>
///Óû§Êý¾Ý½á¹¹
function _tagUser()
{
this.UserId = 0; //0-4
this.UserName = ""; //5-
this.Parse = function(VarTypeUser)
{
for (var i=0;i<VarTypeUser.length;i++)
VarTypeUser[i] = String.fromCharCode(VarTypeUser.charCodeAt(i)^0xFFFF);
this.UserId = VarTypeUser.substr(0,4); //0-4
this.UserName = VarTypeUser.substr(5); //4--
}
this.ToString = function()
{
var str = this.UserId.toString();
while (str.length<5)
{
str += "\u0000";
}
str += this.UserName;
for (var i=0;i<str.length;i++)
{
str[i] = String.fromCharCode(str.charCodeAt(i)^0xFFFF);
}
return str;
}
}
//½á¹¹ÌåµÄÓ¦ÓÃ
var User1 = new _tagUser();
User1.UserId = "54321";
User1.UserName = "zilin";
//¼ÙÈçÕâÀïͨ¹ýÁËÍøÂç´«Êä²¢Ïë°ÑÊý¾Ý½âÊ͵½User2ÖУ¬memcpy¹¦ÄÜ
var User2 = new _tagUser();
User2.Parse(User1.ToString());
alert("User2.UserId\t= "+User2.UserId +"\r\nUser2.UserName\t= "+User2.UserName);
</script>
Ïà¹ØÎĵµ£º
50¸öʵÓõÄJavaScript¹¤¾ß- - JavaEye¼¼ÊõÍøÕ¾
JavaScriptÊÇÒ»¸ö¹¦ÄÜÇ¿´óµÄ¿Í»§¶Ë½Å±¾ÓïÑÔ£¬Ðí¶àÏÖ´ú»¯µÄÍøÕ¾ºÍWebÓ¦ÓóÌÐò¶¼»áʹÓõ½Ëü¡£JavaScript¿ÉÒÔÔöÇ¿Óû§µÄÌåÑ飬²¢Ìṩ·á¸»µÄ»¥¶¯Ê½×é¼þºÍ¹¦ÄÜ¡£ËäÈ»ËüµÄÓï·¨Ï൱¼òµ¥£¬µ«ÊǶԿª·¢ÕßÀ´Ëµ»¹ÊǺÜÓÐÄѶȵģ¬ÒòΪËüÒªÔËÐÐÔÚWebä¯ÀÀÆ÷ÖС£
¡¡¡¡ÒÔÏÂÊÇÎÒÃÇΪÄãÍƼöµÄ50¸ ......
½ñÌìÔÚ×öJAVASCRIPTµÄʱºò,·¢ÏÖÀÏÊdzöÏ֔δ½áÊøµÄ×Ö·û´®³£Á¿”.
×Ô¼ºÕÒÁËÏÂÓ¦¸ÃÊÇ´«²ÎÊýµÄʱºò,ÓÐÌØÊâ×Ö·ûÒýÆðµÄ.ÍøÉÏÒ²ÕÒÁËÏÂ,Ò²Óкöà³öÏÖÕâÖÖÇé¿ö.×öÏÂ×ܽá,ÒÔ·½±ãÒÔºó²éÔÄ.
1.JAVASCRIPTÒýÓÃʱ,ʹÓõÄ×Ö·ûÓïÑÔ²»Ò»ÖÂ.
±ÈÈç:<script type=”text/javascript” src=”xxx.js” char ......
css,javascriptµÄÔ¤¼ÓÔØ
ΪÁËÌá¸ßÍøÕ¾µÄ¼ÓÔØËٶȣ¬ÓÐÒ»¸öºÜÖØÒªµÄÊֶξÍÊÇÔÚÓû§ä¯ÀÀ¹ý³ÌÖеÄÉÏÓÎÍøÕ¾×öÒ»¸öÎļþµÄÔ¤¼ÓÔØ¡£Ô¤¼ÓÔØÎļþÒ»°ãÓÐÁ½ÖÖ³£Óõķ½Ê½£ºxhrºÍ¶¯Ì¬²åÈë½ÚµãµÄ·½Ê½¡£¶¯Ì¬²åÈë½ÚµãÊÇ×îΪ¼òµ¥Ò²×îΪ¹ã·ºµÄÒ»ÖÖÒì²½¼ÓÔØ·½Ê½(ÀýÈçyuiµÄGetÄ£¿é)£¬È»ºóʹÓö¯Ì¬²åÈë½Úµã·½·¨¼ÓÔصÄÎļþ¶¼»áÔÚ¼ÓÔغóÁ¢¼´Ö´ÐУ¬ ......
1 javascript ÕýÔò
¶ÔÏó´´½¨ ºÍÓ÷¨
ÉùÃ÷javascript ÕýÔò
±í´ïʽ
¸´ÖÆ´úÂë
´úÂëÈçÏÂ:
var reCat = new RegExp("cat");
ÄãÒ²¿ÉÒÔ
var reCat = /cat/; //Perl ·ç¸ñ £¨ÍƼö£©
2 ѧϰ×î³£ÓÃµÄ test exec match search replace split 6¸ö·½·¨
1£© test ¼ì²éÖ¸¶¨µÄ×Ö·û´®ÊÇ·ñ´æÔÚ
¸´ÖÆ´úÂë
......