public
Description: a userscript for auto loading paginated web pages
Homepage: http://userscripts.org/scripts/show/8551
Clone URL: git://github.com/swdyh/autopagerize.git
Search Repo:
Click here to lend your support to: autopagerize and make a donation at www.pledgie.com !
 * fixed xpath.
swdyh (author)
Sat Jun 28 11:48:48 -0700 2008
commit  1e97a6b7109aa068ea7d8fc4628c60c955609633
tree    4129cd6042353eb906341a7764657c334f0a3ddb
parent  0fbbce24a566dff3d1d7547f133c3ad54c786e47
...
294
295
296
297
 
 
298
299
300
...
304
305
306
307
 
308
309
310
...
294
295
296
 
297
298
299
300
301
...
305
306
307
 
308
309
310
311
0
@@ -294,7 +294,8 @@ AutoPager.prototype.addPage = function(htmlDoc, page) {
0
 
0
     if (page[0] && page[0].tagName == 'TR') {
0
         var insertParent = this.insertPoint.parentNode
0
- var colNodes = getElementsByXPath('child::tr/child::*[self::td or self::th]',insertParent)
0
+ var colNodes = getElementsByXPath('child::tr[1]/child::*[self::td or self::th]', insertParent)
0
+
0
         var colums = 0
0
         for (var i = 0, l = colNodes.length; i < l; i++) {
0
             var col = colNodes[i].getAttribute('colspan')
0
@@ -304,7 +305,7 @@ AutoPager.prototype.addPage = function(htmlDoc, page) {
0
         // td.appendChild(hr)
0
         td.appendChild(p)
0
         var tr = document.createElement('tr')
0
- td.setAttribute('colspan',colums)
0
+ td.setAttribute('colspan', colums)
0
         tr.appendChild(td)
0
         insertParent.insertBefore(tr, this.insertPoint)
0
     }

Comments

    No one has commented yet.