konsalex / Airport-Autocomplete-JS

Airport Autocomplete Input tag
MIT License
31 stars 18 forks source link

Json data gets loaded twice? #1

Closed CodeByFlo closed 5 years ago

CodeByFlo commented 5 years ago

When I use the code in wp it works, but somehow on page load the airports.json gets loaded twice right away and one of them says: An error occurred trying to load the resource (not in the console but in the network tab).

screenshot 2018-11-07 at 16 07 19

Do you have any idea what could be the reason?

Also, I think it would be good to store the data not in .rawgit.com because I believe that service will be shut down soon.

konsalex commented 5 years ago

Hey @meeuwsen ! Thanks for pointing out that GitRaw is shutting down its servers. When I published my repo the service was running but 💩happens.

Now, this seems strange and I will take a look at it. Do you run the code in Wordpress?

CodeByFlo commented 5 years ago

Hi @konsalex, Yes, I have to run it in Wordpress and when I remove one AirportInput("autocomplete-airport-1"); as a test and keep the other it only loads once.

konsalex commented 5 years ago

Hey @meeuwsen ! Just fixed this 🎉 Better late than never 🧐

I would appreciate any further feedback. Also, I stopped using RawGit because is shutting down.