First time here? Check out the FAQ!
0

How to paste custom javascript at one question only?

Is it somehow possible to paste some custom javascript on one specific question only?

Toms's avatar
767
Toms
asked 2014-04-11 13:40:57 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

In the template question/javascript.html you could add something like:

{% if request.path == '/my-url/' %}
<script src="http://example.com/script.js" />
{% endif %}
Evgeny's avatar
13.2k
Evgeny
answered 2014-04-11 13:41:54 -0500, updated 2014-04-11 14:12:51 -0500
edit flag offensive 0 remove flag delete link

Comments

Some agency wants to test my site to be approved by their standards and they want me to paste their code on one test-question-page. If I paste it for all sites, it will eventually break the site for one day.

Toms's avatar Toms (2014-04-11 13:48:42 -0500) edit

Thank you! It works!

Toms's avatar Toms (2014-04-11 14:15:17 -0500) edit
add a comment see more comments