错误提示:
Uncaught TypeError: autopbn.getAttribute is not a function at exauto_ajax_page.js?s1m:10
var autopbn = $('autopbn');
var nextpageurl = autopbn.getAttribute('rel').valueOf();//这句提示Uncaught TypeError: autopbn.getAttribute is not a function at exauto_ajax_page.js?s1m:10
楼上说的很清楚了。
autopbn是一个jQuery对象,自然只能使用jQuery的方法,在此文中是.attr('rel')
getAttribute是DOM对象的操作方法,如必须要使用,以下操作即可
给变量加上$,表明这是个jQuery对象,区别于DOM对象