js 提示信息

来源:互联网 发布:软件测试工作日志 编辑:程序博客网 时间:2024/05/19 00:55

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb18030" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="Keywords" content="关键词1,关键词2,关键词3,关键词4,……" />
<meta name="Description" content="你网页的简述" />
<meta name="Robots" content="All" />
<meta name="Generator" content="Dreamweaver" />
<meta name="Author" content="第五只鼠,email" />
<meta name="Copyright" content="本页版权归第五只鼠所有。All Rights Reserved" />
<title>无标题文档</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<script src="date.js"></script>
<script language="javascript">
  String.prototype.Trim  =  function()
  {
  return  this.replace(/(^/s*)|(/s*$)/g,""); 
 }
 
 function goto()
 {
  if(check()){
      document.form1.submit();
  }
 }

 function check()
 {
  if(document.all.form1.title.value.Trim()==""){
   alert("请填写标题!");
   return false;
   }

   return true;
 }
 //限制显示内容的长度
 function fixTitleLength(titleContent,titleLength){
 var content = titleContent.toString();
 var length = Number(titleLength);
 if(content.length>length){
 content = content.substring(0,length)+"...";
 }
 
 return (content);
 }
 //创建层显示全部的提示内容
 var titleSpan ;
 var x,y;
 function showTitleContent(content){
 
 if(typeof (titleSpan)=='undefined'){
  titleSpan = document.createElement("<span id='spanid' class='spanstyle'></span>");
  document.body.appendChild(titleSpan); 
 }
 var yScroll;
 if (self.pageYOffset) {
  yScroll = self.pageYOffset;
  xScroll = self.pageXOffset;
 } else if (document.documentElement && document.documentElement.scrollTop){  // Explorer 6 Strict
  yScroll = document.documentElement.scrollTop;
  
 } else if (document.body) {// all other Explorers
  yScroll = document.body.scrollTop;
 
 }
 
 x = document.body.scrollLeft+event.clientX;
 y = yScroll+event.clientY;
 
    var thisspan = eval("spanid.style");

    thisspan.posLeft=x;
 thisspan.posTop=y;
 
 titleSpan.innerText = content.toString();
 thisspan.display ='block';
 }
 //隐藏要显示的内容
 function hiddenTitleContent(){
 titleSpan.style.display = 'none';
 }
/*
 function showMsg(){
  document.getElementById("div_msg").style.display="block"; 
  }
 function hideMsg(){
  document.getElementById("div_msg").style.display="none"; 
  }
function tips(id,str){
var l=document.getElementById(id).offsetLeft+140;
var t=document.getElementById(id).offsetTop+80;
document.getElementById("tips").innerHTML=str;
document.getElementById("tips").style.left=l+"px";
document.getElementById("tips").style.top=t+"px";
document.getElementById("tips").style.display="";
}
function outtips(){
    document.getElementById("tips").style.display='none';
}
*/
</script>
</head>
<body>
<h3 class="subTitle">文字词汇</h3>

<form id="form1" name="form1" action="#.do">

  <table width="90%" border="0" align="center" cellpadding="0" class="table2" cellspacing="0"><div id="tips" style="position:absolute;border:1px solid #ccc;padding:0px 3px;color:#f00;display:none;height:20px;line-height:20px;background:#fcfcfc"></div>   
      <tr>
          <th align="right" width="10%">問題Ⅰ</th>
          <td colspan="3" onmousemove="javascript:showTitleContent('_のところに何を入れますか。1.2.3.4からいちばんいいものを一つえらびなさい');" onmouseout="javascript:hiddenTitleContent();">            
                <script type="text/javascript">
document.write(fixTitleLength('_のところに何を入れますか。1.2.3.4からいちばんいいものを一つえらびなさい',50));</script>
             <input name="Submit3" type="button" class="button3" value="编辑" onclick="window.location.reload('jlptQuestion1_add.htm');"/>
              </td>
      </tr>
            <tr>
          <th align="right">問題Ⅱ</th>
          <td colspan="3" onmousemove="javascript:showTitleContent('_のところに何を入れますか。1.2.3.4からいちばんいいものを一つえらびなさい');" onmouseout="javascript:hiddenTitleContent();">            
                <script type="text/javascript">
document.write(fixTitleLength('_のところに何を入れますか。1.2.3.4からいちばんいいものを一つえらびなさい',50));</script>
             <input name="Submit4" type="button" class="button3" value="编辑" onclick="window.location.reload('jlptQuestion2_add.htm');"/></td>
      </tr>
            <tr>
          <th align="right">問題Ⅲ</th>
          <td colspan="3" onmousemove="javascript:showTitleContent('_のところに何を入れますか。1.2.3.4からいちばんいいものを一つえらびなさい');" onmouseout="javascript:hiddenTitleContent();">            
                <script type="text/javascript">
document.write(fixTitleLength('_のところに何を入れますか。1.2.3.4からいちばんいいものを一つえらびなさい',50));</script>
             <input name="Submit5" type="button" class="button3" value="编辑" onclick="window.location.reload('jlptQuestion2_add.htm');"/></td>
      </tr>
      <tr>
          <th align="right">問題Ⅳ</th>
         <td colspan="3" onmousemove="javascript:showTitleContent('_のところに何を入れますか。1.2.3.4からいちばんいいものを一つえらびなさい');" onmouseout="javascript:hiddenTitleContent();">            
                <script type="text/javascript">
document.write(fixTitleLength('_のところに何を入れますか。1.2.3.4からいちばんいいものを一つえらびなさい',50));</script>
             <input name="Submit6" type="button" class="button3" value="编辑" onclick="window.location.reload('jlptQuestion1_add.htm');"/></td></tr>
                <tr>
          <th align="right">問題Ⅴ</th>
          <td colspan="3" onmousemove="javascript:showTitleContent('_のところに何を入れますか。1.2.3.4からいちばんいいものを一つえらびなさい');" onmouseout="javascript:hiddenTitleContent();">            
                <script type="text/javascript">
document.write(fixTitleLength('_のところに何を入れますか。1.2.3.4からいちばんいいものを一つえらびなさい',50));</script>
            <input name="Submit7" type="button" class="button3" value="编辑" onclick="window.location.reload('jlptQuestion1_add.htm');"/></td></tr>
     
     
  </table>
  <h3 class="subTitle">阅读语法</h3>
        <table width="90%" border="0" align="center" cellpadding="0" class="table2" cellspacing="0">
         
      <tr>
          <th align="right" width="10%">問題Ⅰ</th>
          <td colspan="3" onmousemove="javascript:showTitleContent('次の文章を読んで、後の問いに答えなさい。答えは、1.2.3.4から最も適当なものを一つ選びなさい。');" onmouseout="javascript:hiddenTitleContent();">            
                <script type="text/javascript">
document.write(fixTitleLength('次の文章を読んで、後の問いに答えなさい。答えは、1.2.3.4から最も適当なものを一つ選びなさい。',50));</script>           <input name="Submit3" type="button" class="button3" value="编辑" onclick="window.location.reload('jlptQuestion2_add.htm');"/></td>
      </tr>
            <tr>
          <th align="right">問題Ⅱ</th>
          <td colspan="3" onmousemove="javascript:showTitleContent('次の文章を読んで、後の問いに答えなさい。答えは、1.2.3.4から最も適当なものを一つ選びなさい。');" onmouseout="javascript:hiddenTitleContent();">            
                <script type="text/javascript">
document.write(fixTitleLength('次の文章を読んで、後の問いに答えなさい。答えは、1.2.3.4から最も適当なものを一つ選びなさい。',50));</script> 
             <input name="Submit8" type="button" class="button3" value="编辑" onclick="window.location.reload('jlptQuestion2_add.htm');"/></td>
      </tr>
            <tr>
          <th align="right">問題Ⅲ</th>
          <td colspan="3" onmousemove="javascript:showTitleContent('次の文章を読んで、後の問いに答えなさい。答えは、1.2.3.4から最も適当なものを一つ選びなさい。');" onmouseout="javascript:hiddenTitleContent();">            
                <script type="text/javascript">
document.write(fixTitleLength('次の文章を読んで、後の問いに答えなさい。答えは、1.2.3.4から最も適当なものを一つ選びなさい。',50));</script>            <input name="Submit5" type="button" class="button3" value="编辑" onclick="window.location.reload('jlptQuestion2_add.htm');"/></td>
      </tr>
      <tr>
          <th align="right">問題Ⅳ</th>
          <td colspan="3" onmousemove="javascript:showTitleContent('次の文章を読んで、後の問いに答えなさい。答えは、1.2.3.4から最も適当なものを一つ選びなさい。');" onmouseout="javascript:hiddenTitleContent();">            
                <script type="text/javascript">
document.write(fixTitleLength('次の文章を読んで、後の問いに答えなさい。答えは、1.2.3.4から最も適当なものを一つ選びなさい。',50));</script>            <input name="Submit6" type="button" class="button3" value="编辑" onclick="window.location.reload('jlptQuestion2_add.htm');"/></td></tr>
                <tr>
          <th align="right">問題Ⅴ</th>
          <td colspan="3" onmousemove="javascript:showTitleContent('次の文章を読んで、後の問いに答えなさい。答えは、1.2.3.4から最も適当なものを一つ選びなさい。');" onmouseout="javascript:hiddenTitleContent();">            
                <script type="text/javascript">
document.write(fixTitleLength('次の文章を読んで、後の問いに答えなさい。答えは、1.2.3.4から最も適当なものを一つ選びなさい。',50));</script>            <input name="Submit7" type="button" class="button3" value="编辑" onclick="window.location.reload('jlptQuestion2_add.htm');"/></td></tr>
     
     
  </table>
     <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="yesno">
  <tr>
            <td height="50" align="center">
             <input type="button" name="Submit" value="返回" onclick="window.location.reload('jlptTest_list.htm');" />
            </td>
        </tr>
    </table>
</form>
</body>
</html>