-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Occasionally: $.ui.autocomplete is undefined #188
Comments
I've been seeing this sporadically too in production. It seems that window load event fires before all scripts are loaded. caused by this change: dea4599 I'll do a fix shortly. Hopefully today. |
I am seeing this on our production server. Unfortunately I could never replicate it locally. Locally, with a throttled connection: jquery-ui is the last to load, and ajax_select.js doesn't run until the window 'load' event. No problem. But what if jquery-ui arrives before jquery ? Then it has no jquery to register itself with. Logically speaking what was missing was to set the two scripts to https://www.html5rocks.com/en/tutorials/speed/script-loading/
Therefore this should work:
They should run one after another. But in other situations there are a lot more scripts on the page and on one admin page I see up to 4 !!! jquerys. Oh dear. At least on my site what happened is that jquery.ui arrived before the jquery 1.9.1 that ajax selects loads. So I've reverted to Going forward, I will switch to a build system that makes a single isolated bundle. Probably switch to select2 so it is smaller and has better ui. This will make releases easier and faster too. The django admin is a jungle, it is best to stay out of it. |
For reference, this was the reason I tried to change from using document.write:
|
I just upgraded to 1.5.1 and tested locally, I reloaded the admin change page a couple of times and got in quite a few instances, the following error message:
That happens already on page load, before I focus the input.
Cache has been emptied and once in a while it works as expected. I assume that the autocomplete plugin is not loaded in time before the ajax-selects code is executed.
The text was updated successfully, but these errors were encountered: