惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
H
Hacker News: Front Page
Stack Overflow Blog
Stack Overflow Blog
B
Blog
I
InfoQ
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
F
Full Disclosure
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
T
Tailwind CSS Blog
S
Secure Thoughts
P
Privacy International News Feed
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LINUX DO - 最新话题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
W
WeLiveSecurity
Google Online Security Blog
Google Online Security Blog
P
Privacy & Cybersecurity Law Blog
D
DataBreaches.Net
Engineering at Meta
Engineering at Meta
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
I
Intezer
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Project Zero
Project Zero
V2EX - 技术
V2EX - 技术
H
Heimdal Security Blog
博客园 - Franky
阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Troy Hunt's Blog
V
Vulnerabilities – Threatpost
H
Help Net Security
Martin Fowler
Martin Fowler
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
博客园 - 【当耐特】

博客园 - TomSun

sql语句优化 页面生存周期 SQL Server 存储过程的分页 利用鼠标中键缩放图片 - TomSun - 博客园 不间断连续图片滚动效果的制作方法 - TomSun - 博客园 IE问题解决方法汇总 Calendar的相关问题. 无法打开注册表关键字错误----修改方法 N级无刷新连动菜单 - TomSun - 博客园 JScript中正则表达函数的说明与应用 正则表达式语法 ASP生成柱型体,折线图,饼图源代码 - TomSun - 博客园 ASP必读[常见问题集] 常用SQL语句(不断更新) JS写的Cookie类 ASP调用系统ping命令 c#.net常用的小函数和方法集 XMLHTTP---介绍 ASP.net 验证码(C#)
Javascript里类的思想(zz) - TomSun - 博客园
TomSun · 2005-08-06 · via 博客园 - TomSun

<script language="javascript" runat="server">
function MyFile(filename, filesize, type, datelastaccessed)
{
 
this.filename = filename;
 
this.filesize = filesize;
 
this.type = type;
 
this.datelastaccessed = datelastaccessed;
}
function ArrayFile()
{
 
this.f = new Array();
 
this.count = 0;
 
this.add=function(file)
 {
  
this.f.push( file );
  
this.count+=1;
 }
 
this.max=function(f1, f2, field)
 {
  
switch( field )
  {
   
case "filename":
    
return f1.filename>f2.filename? true:false;
   
case "filesize":
    
return f1.filesize>f2.filesize? true:false;
   
case "type":
    
return f1.type>f2.type? true:false;
   
case "datelastaccessed":
    
return f1.datelastaccessed>f2.datelastaccessed? true:false;
   
default:
    
return false;
  }
 }
 
this.sort=function(field, order)
 {
 
//order:desc asc
 //field:filename filesize
  var len = this.f.length;
  
if( len < 2 ) return;
  
var tmp;
  
for(var i=0; i<len-1; i++)
  {
   
for(var j=i+1; j<len; j++)
   {
    
if( order == "desc")
    {
     
if!this.max( this.f[i], this.f[j], field ) )
     {
      tmp 
= this.f[i];
      
this.f[i] = this.f[j];
      
this.f[j] = tmp;
     }
    }
    
else if ( order == "asc")
    {
     
ifthis.max( this.f[i], this.f[j], field ) )
     {
      tmp 
= this.f[i];
      
this.f[i] = this.f[j];
      
this.f[j] = tmp;
     }
    }
   }
  }
 }
}
</script>