I all,

Using jQuery 1.2.6 and the latest level of the Star Rating plugin
obtained from www.fyneworks.com. The star rating works fine under most
circumstances, however I can make it break and I am not sure why.

The page I am using it on is a AJAX page - i.e. part of the page is
loaded and reloaded dynamically by some javascript. The dynamic part
of the page contains the star ratings.

As such, when the XMLHTTP response comes back and I set the innerHTML
of the dynamic area of the page I then have to make the all important
call to make the options turn into stars (i.e. $
('[EMAIL PROTECTED]').rating();). Again this normally works
fine. However, if the dynamic area of the page is loaded with the same
content (I use the dynamic area for switching between pages of content
- so when I view page 1 it is fine, but then switching to page 2 and
then back to page 1 triggers the fault) the options have changed to
stars, but the rating (i.e. which star is selected) is not shown - so
all the stars appear grey.

I get an error in my Firefox Error console when this happens:

Error: elem.parentNode is null
Source File: http://www.itakeout.co.uk/js/jquery-1.2.6_030908.js
Line: 25

You can see this error for yourself if you go to
http://www.itakeout.co.uk/select_restaurant.php?search=Portsmouth and
moving between pages. They look fine on the first view, but going back
to them the rating disappears.

I can't think this could be anything I am doing as the stars work fine
most of the time. However, I'd really like to get this resolved. From
the error it looks like either a bug in jQuery or something in the
star rating plugin is causing jQuery to mis-behave. Does anyone have
any ideas? I am pretty new to jQuery and so am not sure exactly what I
need to do here.

Cheers,
Gareth

Reply via email to