10👍
✅
You can just use double quotes around the “P”, because the Django {%
escape prevents the embedded double quote from closing the quotes for the HTML attribute.
<tr onclick="window.location.href='{% url cpm.contacts.views.contact_details "P" c.pk %}'">
👤tom
-2👍
maybe just create a simple jQuery / JS method to change window location and put it ina seperate JS file ?
function change_location(location){
window.location = location;
}
and use it like:
<tr onclick="change_location({% url cpm.contacts.views.contact_details 'P' c.pk %});">
- [Django]-Django session lost when redirected from facebook oauth
- [Django]-Django Count lines in a Subquery
- [Django]-Serve media files with Django on production server
- [Django]-How can you exclude an item in the query set while in a for loop?
Source:stackexchange.com