Guest User

Untitled

a guest
Apr 23rd, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. Django template variable has wrong value / Javascript in HEAD not executed
  2. // inside the javascript
  3. var this_page = "{{ this_page }}";
  4.  
  5. // inside the HTML part
  6. {% ifnotequal this_page "home" %}
  7. ...Some HTML...
  8. {% endifnotequal %}
  9.  
  10. var this_page = "home";
  11.  
  12. var this_page = "about";
  13.  
  14. {% ifnotequal this_page "home" %}
  15. do some javascript
  16. {% endifnotequal %}
Advertisement
Add Comment
Please, Sign In to add comment