首页/技术开发/内容

Asp中代码与页面的分离

技术开发2024-06-06 阅读()
\\n)*)<!--#TPLEND +\\1 *-->","i");
 while(this[name].search(Template_Exp)!=-1)
 {
  arr = this[name].match(Template_Exp);
  
  this[arr[1} = arr[2];
  this[name] = this[name].replace(Template_Exp,"{"+arr[1]+"}");
  this.Split(arr[1]);
 }
}

function Template_Load(name,filename)
{
 var fso = new ActiveXObject("Scripting.FileSystemObject");
 var file = fso.BuildPath(this.TplPath, filename);
 if(fso.FileExists(file))
 {
  var f = fso.OpenTextFile(file, 1);
  this[name] = f.ReadAll();
 }
}
//Template Constructor
function Template(path)
{
 //Property
 this.TplPath = path; 
 //Method
 this.Parse = Template_Parse;
 this.Split = Template_Split;
 this.Load = Template_Load;
}
%>

 



第1页  第2页 

……

相关阅读