On Dec 13, 2008, at 3:19 AM, SLR wrote:


I ended up fixing the issue myself. For those that want to know, it
was type-casting issue. I change the following line:


var pageIndex = $("body").attr("id"); // Pulls ID value from body tag
  pageIndex = pageIndex.substring(4);

to

var pageIndex = $("body").attr("id");    // Pulls ID value from body
tag
pageIndex = parseInt(pageIndex.substring(4)); // Extracts Index from
value

Hopefully, this saves someone else a huge headache...

I see what you're going for there, and the parseInt() function is nice and convenient for this sort of thing. You might want to consider a simpler alternative:

var pageIndex = +$("body").attr("id").slice(4); // Pulls ID from body tag and extracts index from value

--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com

Reply via email to