分頁應該比較簡單的。你就返回一個XML格式的table替換原先的table 就ok.
1,動態刪除Table 裡面內容技巧,不需要寫太多代碼,一行:
tb.removeNode(true)
2,動態增加行,除了CreateElement方法,還可以這樣比較短小:
3,在DIV中動態增加Table
4,在DIV中刪除Table,簡單只要Div.innerHTML=""就可以。
以上是部分實用相對短小的代碼,當然有其他各種辦法實現,不過一般都比上面的長,比如組合使用DIV對象的insertAdjacentHTML 方法等,在不同需要下使用不同方法,前提是研究好瀏覽器模型 的各種對象的方法屬性。尤其是熟悉CSS+HTML就會做的很酷。就JS語言本身來說要求不高。
以下是以Document對象為例,相關方法有:
Method Description
attachEvent
createAttribute
createComment
createDocumentFragment
createElement
createEventObject
createStyleSheet
createTextNode
detachEvent
getElementById
getElementsByName
getElementsByTagName
mergeAttributes
recalc
write
writeln
以DIV對象為例相關方法有:
addBehavior
appendChild
applyElement
attachEvent
clearAttributes
cloneNode
contains
detachEvent
getAdjacentText
getAttribute
getAttributeNode
getElementsByTagName
hasChildNodes
insertAdjacentElement
insertAdjacentHTML
insertAdjacentText
insertBefore
mergeAttributes
normalize
removeAttribute
removeAttributeNode
removeBehavior
removeChild
removeExpression
removeNode
replaceAdjacentText
replaceChild
replaceNode
setActive
setAttribute
setAttributeNode
setExpression
非同步呼叫
非同步呼叫 xmlhttp 取後台資料,你可以搞成PHP的
<%
dim i, xml
xml = ""
xml = xml & ""
for i = 1 to 50
xml = xml & "記錄" & i & ""
next
xml = xml & ""
response.ContentType = "text/xml"
response.write xml
%>