输入框写为这样:<body onload="document.all.txt.focus()">

解决方案 »

  1.   

    输入框写为这样:<body onload="document.all.txt.focus()"><input type="text" name="txt" id="txt" value="输入框">
      

  2.   

    帅哥,你简直太伟大了,刷新的问题帮我解决一下阿。我不想用那个html的那个刷新,那个带屏闪的,不好,还有我显示聊天内容的时候是用的这个方法
    <html>
    <head>
    <title>&Aacute;&Auml;&Igrave;ì</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link type="text/css" rel="stylesheet" href="../css/style.css"></head>
    <body bgcolor="#FFFFFF" text="#000000" >
    <table width="90%" border=0 cellpadding=0 cellspacing=1 align="center">
      <tbody> 
      <script  language='JavaScript'>
    <!--
    var autoScrollOn = 1;
    var scrollOnFunction;
    var scrollOffFunction;function scrollWindow(){
    if ( autoScrollOn == 1 ){
    this.scroll(0,65000);
    setTimeout('scrollWindow()', 200);
    }}function scrollOn(){
    autoScrollOn = 1;
    scrollWindow();}function scrollOff(){
    autoScrollOn = 0;}function StartUp(){
    this.onblur  = scrollOnFunction;
    this.onfocus = scrollOffFunction;
    scrollWindow();}scrollOnFunction = new Function('scrollOn()')
    scrollOffFunction = new Function('scrollOff()')
    StartUp();
    // -->
    </script> <?
     //echo $ID;
     //exit;
     include("../inc/conn.php");
     $sql="SELECT * FROM gx_syjl where yxdID='$yxID' order by sysj desc";
     //echo $sql;
     //exit;
     $result = mysql_query($sql);
    if ($result)
    {
     while ($r=mysql_fetch_array($result))
     {
         $syr=$r["syr"];
     $synr=$r["synr"];
     echo"<tr>";
     echo"<td align='left'><front size='1'>$syr &Euml;&micro;&micro;&Agrave;&pound;&ordm;$synr</front></td>";
     echo"</tr>"; 
          }
    }
    else
     {
     echo "&para;&Ocirc;&sup2;&raquo;&AElig;&eth;&pound;&not;&Iuml;&micro;&Iacute;&sup3;&sup1;&Ecirc;&Otilde;&Iuml;&pound;&iexcl;";
     mysql_free_result($result);
      }?>
      <tr bgcolor="#7285cf"> 
        <td height=2 align=left> </td>
      </tr>
      </tbody> 
    </table>
    </body>
    </html>
    我发现这种方法,显示的内容是把刚发出的内容放在最上面,能不能把发完的放在最下面啊,这样可以随着滚动而走啊
      

  3.   

    function scrollWindow(){
    if ( autoScrollOn == 1 ){
    this.scroll(0,65000);
    setTimeout('scrollWindow()', 200);
    }}
    的this.scroll(0,65000);改成this.scroll(65000,0);把输出的内容改成    输出=新+输出