Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Modifying On Rate - Pop Up Window Rather Thann rate_sucess

Quote Reply
Modifying On Rate - Pop Up Window Rather Thann rate_sucess
I just added some jquery code to the rating system... so the stars light up on mosueover, and you can just click a star to rate. If anyone wants that code, just let me know- happy to share that. Its a cool add in (here is a working sample page: http://www.bcdb.com/cartoon/13-Snow_White_And_The_Seven_Dwarfs.html Just look for the Purple stars!)

Anyway, it hooks right into rate.pm, so it has all the user can only vote once protections and all that. My only real problem is that when you click a star and rate a cartoon, rate.pm sends you to rate_sucess.html... which is cool normally, but for this method of voting, it would be better if the page does not change, and maybe just a pop up window appears that says, "Thanks For Voting" and you click to make it disappear.

Looks like this is the code in rate.pm where we are sent to rate_sucess.html:

Code:

print $IN->header();
print Links::SiteHTML::display ('rate_success', $results);

}
}

ANyone know how I can change thjis to just have an alert box appear instead of going to a new page?

Thanks!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Modifying On Rate - Pop Up Window Rather Thann rate_sucess In reply to
FWIW, I CAN generate the Alert Box in jquery on the page itself.... just have to make rate.pm not change the page... just want to make sure I do this all right!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Modifying On Rate - Pop Up Window Rather Thann rate_sucess In reply to
It is not Rate.pm which changes the page, it's the JS rating implementation.

If you want the user not to leave the page after the rating, you need AJAX.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Modifying On Rate - Pop Up Window Rather Thann rate_sucess In reply to
I do not think so. The jQuery posts the form to rate.pm. Rate.pm does all the magic with averaging and putting the new numbers into the database.... and as the code above shows returns the ratings success page. I just want rating.pm to return something to fire an alert over the existing page and not reload- no reason to reload with jQuery.
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Modifying On Rate - Pop Up Window Rather Thann rate_sucess In reply to
Yep, I'm pretty sure you do need ajax.

It's not what rate.pm returns, it's how your javascript interacts with it.

You can find some useful info and solutions by other people in this tread:
http://www.gossamer-threads.com/...ting_system_P305964/

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins