Jump to content

Making JQuery to load first in admin panel


lozaria

Recommended Posts

Hello,

I don't know how this happened but suddenly the admin of my Prestashop 1.7.5.2 started to show errors. The loading icon in admin up in the left continues to spin even after the page is fully loaded. 
I the inspector I see the following errors:

jquery.ui.slider.min.js:4 Uncaught TypeError: Cannot read property 'mouse' of undefined
    at jquery.ui.slider.min.js:4
    at jquery.ui.slider.min.js:4
(anonymous) @ jquery.ui.slider.min.js:4
(anonymous) @ jquery.ui.slider.min.js:4
admin-theme.js:300 Uncaught TypeError: $(...).dropdown is not a function
    at HTMLDocument.<anonymous> (admin-theme.js:300)
    at j (VM7891 jquery-1.11.0.min.js:2)
    at Object.fireWith [as resolveWith] (VM7891 jquery-1.11.0.min.js:2)
    at Function.ready (VM7891 jquery-1.11.0.min.js:2)
    at HTMLDocument.K (VM7891 jquery-1.11.0.min.js:2)

So it seems that the Jquery is loaded after some modules/scripts that require it.
I don't know how to make the jquery and jquire ui to load before those modules.

I tried to edit admin/themes/default/template/header.tpl and put right after the </title> the code that loads jquery and jquery ui:

<script type="text/javascript" src="/js/jquery/jquery-1.11.0.min.js" defer></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js" defer></script>

In the HTML source code it is shown exactly where it is but in the inspector/dom it still remains below some .js calls:

<script src="/admin3/themes/default/js/vendor/enquire.min.js"></script>
<script src="/admin3/themes/default/js/admin-theme.js"></script>
<script type="text/javascript" src="/js/jquery/jquery-1.11.0.min.js" defer=""></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js" defer=""></script>

I'm starting to feel desperate and will appreciate if anyone can give me an advise with this.

Many thanks in advance!

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...