前端

img sup_haiker

新闻类

发表于2004/10/16 18:13:00  581人阅读

<!--
使用的样式表:<link href="../css/news.css" rel="stylesheet" type="text/css">
-->

<%
function AddNews(DataConnection)
{
   var sql,DataConnection;
   sql="insert into News (subject,ntime,author,ngroup,content) values ('"+this.subject+"','"+this.time+"','"+this.author+"','"+this.group+"','"+this.content+"')";
   Result=DataConnection.Execute(sql);
}
function DeleteNews(DataConnection,id)
{
 var id,sql,DataConnection;
 sql="delete from News where id="+id;
 DataConnection.Execute(sql);
}
function UpdateNews(DataConnection,id)
{
 var id,sql;
 sql="update News set subject='"+this.subject+"',ntime='"+this.time+"',author='"+this.author+"',ngroup='"+this.group+"',content='"+this.content+"' where id="+id;
 DataConnection.Execute(sql);
}
function SetNews(subject,time,author,group,content)
{
    this.subject=subject;
    this.time=time;
    this.author=author;
    this.group=group;
    this.content=content;

function ShowNews()
{
//    this.content=this.content.value.replace(/ /g,"++++");
 this.content=this.content.value.replace(/[/r]/g,"<br>&nbsp;&nbsp;");

    Response.Write("<p align='center' class='title'>"+this.subject+"<br></p><br>");
    Response.Write("<p class='paragraph'>"+this.content+"</p>");
    Response.Write("<P align='right'>文章来源:"+this.author+"&nbsp;&nbsp;&nbsp;&nbsp;</p>");
    Response.Write("<p align='right'>"+this.time+"&nbsp;&nbsp;&nbsp;&nbsp;</p>");
 Response.Write("<hr width='95%' align='center' height='1'>");

}
function News()
{
    this.subject="新闻主题";
    this.time="发布时间";
    this.author="作者"; 
    this.group="新闻组";
    this.content="新闻内容";
    this.AddNews=AddNews;
    this.SetNews=SetNews;
    this.ShowNews=ShowNews;
    this.UpdateNews=UpdateNews;
    this.DeleteNews=DeleteNews;
}
%>

阅读全文
0 0

相关文章推荐

img
取 消
img