⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addnews.jsp

📁 煤矿安全实时监控系统(简单新闻发布系统) 主页上的登陆是ajax的
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*"  %>
<!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>
<SCRIPT language=JavaScript>
<!--
function openwin(url, width, height)
{
var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=1,menubar=0,status=1');
}
function addimages()
{
	var post=prompt("请输入您上传的图片路径","完整的地址");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[img]"+post+"[/img]";
	}
}
function aaa()
{
	
		document.post.content.value=document.post.content.value+"[img]"+<%=session.getAttribute("image")%>+"[/img]";
	
}
function addMood(mood)
{
	document.post.content.value=document.post.content.value+mood;
}
function addBold()
{
	var post=prompt("输入要加粗的文字","文字");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[b]"+post+"[/b]";
	}
}
function addEm()
{
	var post=prompt("输入要倾斜的文字","文字");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[i]"+post+"[/i]";
	}
}
function addCenter()
{
	var post=prompt("输入要居中显示的文字","文字");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[center]"+post+"[/center]";
	}
}
function addLeft()
{
	var post=prompt("输入要左对齐的文字","文字");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[left]"+post+"[/left]";
	}
}
function addRight()
{
	var post=prompt("输入要右对齐的文字","文字");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[right]"+post+"[/right]";
	}
}
function addURL()
{
	var post=prompt("请输入完整的地址\n比如http://www.jzhzg.com","完整的地址");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[url]"+post+"[/url]";
	}
}
function addEmail()
{
	var post=prompt("请输入完整的邮件地址\n比如hack520vip@21cn.com","完整的地址");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[email]"+post+"[/email]";
	}
}
function addQuote()
{
	var post=prompt("请输入引用的文字","文字");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[quote]"+post+"[/quote]";
	}
}
function setFont(font)
{
	var post=prompt("请输入想改变字体的文字","文字");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[font="+font+"]"+post+"[/font]";
	}
}
function setSize(size)
{
	var post=prompt("请输入想改变大小的文字","文字");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"[size="+size+"]"+post+"[/size]";
	}
}
function setColor(color)
{
	var post=prompt("文字染色","文字");
	if(post!=null)
	{
		document.post.content.value=document.post.content.value+"["+color+"]"+post+"[/"+color+"]";
	}
}
-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加新闻</title>
<style type="text/css">
<!--
body {
	background-color: #FFFFFF;
}
.STYLE1 {color: #FFFFFF}
#Layer1 {
	position:absolute;
	width:200px;
	height:115px;
	z-index:1;
	left: 280px;
	top: 144px;
}
-->
</style></head>

<body>
<form action="/meikuang/addNews.do" method="post" enctype="multipart/form-data" name="post" id="form1">
<table width="662" height="146" border="1" align="center">
<tr>
   
    <td width="652" height="49" bgcolor="#0000FF"><label></label>
      <label>
      <div align="center"><span class="STYLE1">添 加 新 闻</span></div>
      </label></td>
  </tr>
  <tr>
   
    <td width="652" height="49"><label>新闻标题:
        <input name="title" type="text" id="title" size="30" />
    </label>
      <label>*</label></td>
  </tr>
  <tr>
    
    <td height="38">作者:
      <label>
      <input name="users" type="text" id="textfield" size="30" />
      </label></td>
  </tr>
   <tr>
    
    <td height="38">新闻类别:
      <label>
      <select name="classes">
        <option>选择新闻类别</option>
        <option value="1">领导讲话</option>
        <option value="2">检查动态</option>
        <option value="3">行业动态</option>
        <option value="4">安全评估</option>
        <option value="5">伤亡事故</option>
      </select>
      </label></td>
  </tr>
  <tr>
    
    <td height="38">上传图片:
      <label>
      <a href="JavaScript:openwin('up.jsp',600,500)">点击上传图片
      </a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="JavaScript:aaa()">点击加入图片</a></label></td>
  </tr>
  <tr>
    
    <td height="49" bgcolor="#ECE9D8"><div align="center">
      <p>新闻内容*</p>
      <p><select name="selectFont" id="selectFont" onChange="setFont(this.options[this.selectedIndex].value)">
                        <option selected>选择字体</option>
                        <option value="宋体">宋体</option>
                        <option value="黑体">黑体</option>
                        <option value="隶书">隶书</option>
                        <option value="幼圆">幼圆</option>
                        <option value="仿宋_GB2312">仿宋_GB2312</option>
                        <option value="Arial">Arial</option>
                        <option value="Times New Roman">Times New Roman</option>
                      </select> 
                      <select name="selectSize" id="selectSize" onChange="setSize(this.options[this.selectedIndex].value)">
                        <option selected>字体大小</option>
                        <option value="6">6</option>
                        <option value="8">8</option>
                        <option value="10">10</option>
                        <option value="12">12</option>
                        <option value="14">14</option>
                        <option value="18">18</option>
                        <option value="24">24</option>
                        <option value="36">36</option>
                      </select> 
                      <select name="selectColor" id="selectColor" onChange="setColor(this.options[this.selectedIndex].value)">
                        <option value="" selected>选择颜色</option>
                        <option value="red">红色</option>
                        <option value="blue">蓝色</option>
                        <option value="yellow">黄色</option>
                        <option value="green">绿色</option>
                      </select> 
                   
                      <a href="javascript:" onClick="addBold()"><img src="images/ubb/bold.gif" alt="字体加粗" width="20" height="20" border="0"></a> 
                      <a href="javascript:" onClick="addEm()"><img src="images/ubb/italic.gif" alt="字体倾斜" width="20" height="20" border="0"></a> 
                      <img src="images/ubb/separator.gif" width="6" height="20"> <a href="javascript:" onClick="addLeft()"> 
                        <img src="images/ubb/left.gif" alt="字体左对齐" width="20" height="20" border="0"></a> 
                      <a href="javascript:" onClick="addCenter()"> <img src="images/ubb/center.gif" alt="字体居中" width="20" height="20" border="0"></a> 
                      <a href="javascript:" onClick="addRight()"> <img src="images/ubb/right.gif" alt="字体靠右" width="20" height="20" border="0"></a> 
                      <img src="images/ubb/separator.gif" width="6" height="20"> <a href="javascript:" onClick="addimages()"><img src="images/ubb/image.gif" alt="引用外部图片" width="20" height="20" border="0"></a><img src="images/ubb/separator.gif" width="6" height="20"> <a href="javascript:" onClick="addQuote()"><img src="images/ubb/quote.gif" alt="插入引用" width="20" height="20" border="0"></a>
                      <a href="javascript:" onClick="addURL()"><img src="images/ubb/link.gif" alt="加入超链接" width="20" height="20" border="0"></a>
                      <a href="javascript:" onClick="addEmail()"><img src="images/ubb/email.gif" alt="插入Email" width="20" height="20" border="0"></a></p>
      <p>
        <textarea name="content" cols="70" rows="15" wrap="VIRTUAL" class="form" id="content"></textarea>
      </p>
      <p>
        <label>
        <input type="submit" name="button" id="button" value="提交" /> 
        </label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <label>
        <input type="reset" name="button2" id="button2" value="重置" />
        </label>
      </p>
    </div>      </td>
  </tr>
</table>
</form>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -