开发者

jquery appendTo() not working in IE 7,8

I am using jquery to do paginations. My code is wroking fine in FF but in IE it says the error on linee 255 in jquery.js

and its is on the append function

what should i do

var $pager开发者_如何学Python = $j('<br><span class="pager"></span>');
$j('<span class="page-number" >' + (page + 1) + '</span>')
.appendTo($pager).addClass('clickable').addClass('over');

This is not the full code but the error is due to appendTo line , if i remove that line then there is no error


How about not using appendTo:

var $pager = $j('<br><span class="pager"></span><span class="page-number" >' + (page + 1) + '</span>').addClass('clickable').addClass('over');

Does this make sense?


I think the <br> is messing it up, try it with $pager referencing only the <span/>.

var $pager = $j('<span class="pager"></span>');
$j('<span class="page-number" >' + (page + 1) + '</span>')
    .appendTo($pager)
    .addClass('clickable')
    .addClass('over');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜