On Aug 9, 4:59 pm, Sven Richter <[email protected]> wrote:
> I am looking for a rating function AJAX style.
> So what i am trying to do is the following:
>
> Click on a link <a id="vote_up"...
> register a Jquery function to call on that click with:
> $('a#vote_pos').click(rate_it);
> and then in rate_it call the url rate with two paramaters int entry and
> string pos_neg
> like
> $.ajax( {type:"POST", url:/entry/rate/pos_neg, ...
> and i wanted to build the url with the url tag like:
> url:{% url rate entry pos_neg %}
>
> Sven
>

Rather than having a dynamic URL with parameters, you'll just have to
make the parameters part of the POST. So you can still use the url tag
at render time to output the URL, but instead of it being /entry/5/
rate/positive/ it should just be eg /entry/rate/, and the values for
rate and pos_neg are keys in the POST.
--
DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to