Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Jquery loaded only if not already loaded #1459

Closed
wants to merge 1 commit into from

2 participants

@edoardo-esposito

No description provided.

@ojii
Collaborator

Hi,

The proper way to solve this issue is by using sekizai for your main jquery too. If you use the same {% addtoblock "js " %}...{% endaddtoblock%} statement for your main jquery, it will only load once.

Going to close this pull request.

@ojii ojii closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 1, 2012
  1. @edoardo-esposito
This page is out of date. Refresh to see the latest.
View
2  cms/plugins/twitter/templates/cms/plugins/twitter_recent_entries.html
@@ -1,5 +1,5 @@
{% load i18n sekizai_tags %}
-{% addtoblock "js" %}<script type="text/javascript" src="{{ STATIC_URL }}admin/js/jquery.min.js"></script>{% endaddtoblock %}
+{% addtoblock "js" %}<script type="text/javascript">!window.jQuery && document.write('<script type="text/javascript" src="{{ STATIC_URL }}admin/js/jquery.min.js"><\/script>');</script>{% endaddtoblock %}
{% addtoblock "js" %}<script type="text/javascript" src="{{ STATIC_URL }}cms/js/libs/jquery.tweet.js"></script>{% endaddtoblock %}
{% addtoblock "js" %}
<script type="text/javascript">
Something went wrong with that request. Please try again.