JavaScript ¶ÁÈ¡ JSON
JSON:
[{"subjecttypeId":"1","subjectName":"67","scope":"1",},{"subjecttypeId":"1","subjectName":"345","scope":"1"}]
JavaScript:
var result = window.eval('(' + JSON+ ')');
for(var p in result){
result[p].subjectName;
alert(result[p].subjectName);
}
Ïà¹ØÎĵµ£º
Data Formats Êý¾Ý¸ñʽ
When considering data transmission techniques, you must take into account several factors: feature set, compatibility, performance, and direction (to or from the server). When considering data formats, the only scale you need for comparison is speed.
......
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:
×ܵÄÀ´ËµÔ½ÇáÁ¿¼¶µÄ¸ñʽԽºÃ£¬× ......
JavaScript Minification JavaScript½ô´Õ
JavaScript minification is the process by which a JavaScript file is stripped of everything that does not contribute to its execution. This includes comments and unnecessary whitespace. The process typically reduces the file size by ha ......
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Öеõ½µ±Ç°´°¿ÚµÄ¸ßºÍ¿í
<body><SCRIPT LANGUAGE="JavaScript">
var s = "";
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clien ......