Ask Your Question
0

How to paste custom javascript at one question only?

asked 2014-04-11 13:40:57 -0600

Toms gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-04-11 13:41:54 -0600

Evgeny gravatar image

updated 2014-04-11 14:12:51 -0600

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

{% if request.path == '/my-url/' %}
<script src="http://example.com/script.js" />
{% endif %}
edit flag offensive delete link more

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 gravatar imageToms ( 2014-04-11 13:48:42 -0600 )edit

Thank you! It works!

Toms gravatar imageToms ( 2014-04-11 14:15:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-04-11 13:40:57 -0600

Seen: 60 times

Last updated: Apr 11 '14