<script language=Javascript>  //自己动手为string添加Trim
String.prototype.Trim  = function(){return this.replace(/^\s+|\s+$/g,"");}if(document.formName.inputName.value.Trim()=="") alert("empty");
</script>定时刷新:
<meta http-equiv="refresh" content="5"> 5秒刷新

解决方案 »

  1.   

    if(document.getElementById("textId")==""){
    alert("text is null!");
    ......}
      

  2.   

    1 <meta http-equiv="refresh" content="间隔秒数">   //定时刷新
    2 function ff()                                    //________
      { 
         window.reload()
         abc=setTimeout("ff()",刷新秒数)
      }
    ff();
    <script>
    function aa()
    {
         var bb=document.form1.text1.value
         if(bb=="")
         {
         alert("是空的")
         }
         else
         {
         alert("非空")
         }
    }</script>
      

  3.   

    function init()
    {
    Date now=new Date()
    Date setTime=new Date();
    if(now==setTime)
      window.location.href=***
    setTimeout("init()",1000);
    }<body onload="init()">
      

  4.   

    <--------------高手看过来! 能不能搞定这个?
    http://community.csdn.net/Expert/topic/3472/3472337.xml?temp=.1701624