Ctrl+/
IE11
F11
ESC
PgUp
PgDn
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Javascript数组排序</title>
<script type="text/javascript">
s = [
{first:'joe',last:'awk'},
{first:'zwe',last:'oli'},
{first:'joe',last:'asp'}
];
for(var i=0;i<s.length;i++){
document.write(s[i].first + " " + s[i].last + "<br/>");
}
document.write("<hr/>")
s.sort(function(a,b){
var result = a.first.localeCompare(b.first);
if(result == 0)
result = a.last.localeCompare(b.last);
return result;
})
</script>
</head>
<body>
</body>
</html>
CSS代码...
JS代码...
xxxxxxxxxx