新闻类

<!--
使用的样式表:<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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值