以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XML基础 』  (http://bbs.xml.org.cn/list.asp?boardid=1)
----  [求助]其实是非常简单的问题,哪位高手帮忙调试下。感激不尽  (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=46250)


--  作者:aprilangela
--  发布时间:4/29/2007 5:29:00 PM

--  [求助]其实是非常简单的问题,哪位高手帮忙调试下。感激不尽
书上的例子。怎么都说我这一行有错误 objbook没有定义。但先显示书本信息再翻页就没有问题。 哪位高手帮忙调试下错误到底出在哪里?


    if((pageno)<(objbook.RecordCount)/tblbook.dataPageSize)

源代码:

<XML id="XMLDSO" src="code7_6.xml"></XML>
<html>
   <head>
      <title>分页分条显示书本信息</title>
   </head>
   <script language=JavaScript>
      var pageno=1;
      function SelectRecord(Element)
      {
      //获取记录号
        RecordNo = Element.parentElement.rowIndex;
        objbook = XMLDSO.recordset;
        objbook.absoluteposition = RecordNo+(pageno-1)*tblbook.dataPageSize;
        title.innerHTML =objbook("title").value;
        bookcategory.innerHTML = objbook("bookcategory").value;
        ISBN.innerHTML = objbook("ISBN").value;
        author.innerHTML = objbook("author").value;
        publisher.innerHTML = objbook("publisher").value;
        price.innerHTML = objbook("price").value;
        remain.innerHTML = objbook("remain").value;
        }
        function pre_page()
        {
         if (pageno>1)
           { tblbook.previousPage();
            pageno=pageno-1;}
        }
        function next_page()
        {
           if((pageno)<(objbook.RecordCount)/tblbook.dataPageSize)
           { tblbook.nextPage();
           pageno=pageno+1;}
           }
   </script>
   <body>
     <center><b>分页分条显示书本信息</b></center>
       <table id=tblbook datasrc="#XMLDSO" border="1" align="center" datapagesize=3>
   <thead>
    <th>书名</th><th>类别</th><th>书号</th><th>作者</th><th>出版社</th><th>定价</th><th>剩余量</th>
   </thead>     
   <tr>
    <td onclick=SelectRecord(this)><span datafld="title"></span></td>
    <td onclick=SelectRecord(this)><span datafld="bookcategory"></span></td>
    <td onclick=SelectRecord(this)><span datafld="ISBN"></span></td>
    <td onclick=SelectRecord(this)><span datafld="author"></span></td>
    <td onclick=SelectRecord(this)><span datafld="publisher"></span></td>
    <td onclick=SelectRecord(this)><span datafld="price"></span></td>
    <td onclick=SelectRecord(this)><span datafld="remain"></span></td>
   </tr>     
  </table>
      <hr>
      <center>
      <input type="button" onclick="pre_page()" value="上一页">
       <input type="button" onclick="next_page()" value="下一页">
        每一页<input type=text value="3" size="5" onblur="tblbook.dataPageSize=this.value">笔
       </center>
       <center>请单击上表有兴趣的图书行</center>
       <hr>
       <center>单本图书信息:书名:<span id="title"></span></center>
            <table border="1" align="center">
     <tr><td width="50%">
         分类:<span id="bookcategory" ></span><br></br>
         书号:<span id="ISBN" ></span><br></br>
         作者:<span id="author" ></span><br></br>
         </td>        
    <td width="50%">
         出版:<span id="publisher" ></span><br></br>
         定价:<span id="price" ></span><br></br>
         剩余:<span id="remain" ></span><br></br>
         </td> 
        </tr>       
   </table>
   <hr>
   </body>
</html>



W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
7,609.375ms