I'm using DevDemon Forms, on two of my pages, which requires that jquery be included in the the document head. On other pages however, I want to include jquery in the footer.
So i thought I would post this in the header:
{if "{segment_2}" == "skjema" OR "{segment_2}" == "nyhetsbrev"}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{site_url}js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
{/if}
Then post this in the footer:
{if "{segment_2}" != "skjema" OR "{segment_2}" != "nyhetsbrev"}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{site_url}js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
{/if}
The first part works fine, as jquery is now only included in the header on page "skjema" and "nyhetsbrev".
The second part does not work, as it includes jquery no matter what, which means I'm including jquery twice on pages using Forms.