class =''tableGridList''>", "< tr>", " < td class =''colHead''align =''center''>& nbsp;< / td>", " < td class =''colHead''align =''center''> Price< / td>", " < td class =''colHead''align =''center''> Beds< / td>", " < td class =''colHead''align =''center''> Baths< / td>", " < td class =''colHead''align =''center''> SqFt。< / td>", "< / tr>", "< tr valign =''top''class =''rowOff''onMouseOver =''this.className = \" rowOn \"'' onMouseOut =''this.className = \" rowOff \"''>", " < td class =''grid''align =''center''>< a class =''inlineActionLink'' href =''detailinfo.php?MlsNum =#0& nomap = true''title =''无法找到 map''>详细信息< / a>< / td>", " < td class =''tableContent''align =''right''>#1< / td>", " < td class =''tableContent''align =''center''>#2< / td>", " < td class =''tableContent''align =''center''>#3< / td>", " < td class =''tableContent''align =''center''>#4< / td>", "< / tr>", "< / table>" ]; 函数changePage(index){ var dataBuild =" " ;; for(var i = 0; i< dataTable.length; i ++){ dataBuild + = dataTable [i]; } var dataValue = dataArray [index] .split(" ^"); for(var j = 0; j< dataArray [index] .length ; j ++){ dataBuild = dataBuild.replace("#" + j,dataValue [j]); } 文件.getElementById(" panel")。innerHTML = dataBuild; } < / script> < / head> < body onload =" changePage(0)"> < table border =" 0" CELLPADDING = QUOT; 0" CELLSPACING = QUOT; 0" width =" 300"> < tr> < td width =" 100%" style =" padding:2px;"> < div id =" panel">< / div> < / td> < / tr> < tr> < td> < a href =" ;#"的onClick = QUOT;的JavaScript的 的:changePage(0);"大于1< / A> | < a href ="#" onClick =" javascript :changePage(1);"> 2< / a> < / td> < / tr> < / table> < / body> < / html>[snip]Try this version:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title> dataTable.htm</title><script type="text/javascript">var dataArray = ["531245^129,900^3^3^1,720","513195^124,500^4^3^1,528"];var dataTable = ["<table border=''1'' cellpadding=''2'' cellspacing=''1'' width=''100%''class=''tableGridList''>","<tr>"," <td class=''colHead'' align=''center''> </td>"," <td class=''colHead'' align=''center''>Price</td>"," <td class=''colHead'' align=''center''>Beds</td>"," <td class=''colHead'' align=''center''>Baths</td>"," <td class=''colHead'' align=''center''>SqFt.</td>","</tr>","<tr valign=''top'' class=''rowOff'' onMouseOver=''this.className=\"rowOn\"''onMouseOut=''this.className=\"rowOff\"''>"," <td class=''grid'' align=''center''><a class=''inlineActionLink''href=''detailinfo.php?MlsNum=#0&nomap=true'' title=''Unable to locate onmap''>Details</a></td>"," <td class=''tableContent'' align=''right''>#1</td>"," <td class=''tableContent'' align=''center''>#2</td>"," <td class=''tableContent'' align=''center''>#3</td>"," <td class=''tableContent'' align=''center''>#4</td>","</tr>","</table>"];function changePage(index) {var dataBuild = "";for (var i=0; i<dataTable.length; i++) {dataBuild += dataTable[i];}var dataValue = dataArray[index].split("^");for (var j=0; j<dataArray[index].length; j++) {dataBuild = dataBuild.replace("#"+j,dataValue[j]);}document.getElementById("panel").innerHTML = dataBuild;}</script></head><body onload="changePage(0)"><table border="0" cellpadding="0" cellspacing="0" width="300"><tr><td width="100%" style="padding:2px;"><div id="panel"></div></td></tr><tr><td><a href="#" onClick="javascript:changePage(0);">1</a> |<a href="#" onClick="javascript:changePage(1);">2</a></td></tr></table></body></html> 这篇关于更改数据而不刷新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-12 15:55