Skip to content
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

Isotope filter buttons work on localhost but won't work on hosted server #1671

Open
vankishdelfuturo opened this issue Jul 17, 2024 · 5 comments

Comments

@vankishdelfuturo
Copy link

vankishdelfuturo commented Jul 17, 2024

  1. Open www.vankish.com
  2. In the portfolio tab you will find the masonry style gallery working, but the filtering buttons do not work
  3. On localhost they work as expected. When uploaded to the server (Hostinger) they stop working
@thesublimeobject
Copy link
Collaborator

@vankishdelfuturo — i don't think the link you provided works. in addition, i would need to see the code you wrote in order to help. happy to assist if you can give me more information!

@vankishdelfuturo
Copy link
Author

Thanks for your time, man! Sorry about that formatting error, the link is fixed now.

Here is the codepen for my website https://codepen.io/vankishfrombahamas/pen/gONPmde
Keep in mind all my files come from a database so the preview might look pretty broken

@thesublimeobject
Copy link
Collaborator

@vankishdelfuturo — okay, so just looking at your website real quick, i'm seeing an error: main.js:165 Uncaught ReferenceError: $ is not defined. so my best guess is that you don't have jquery included before your main.js script, which is preventing the rest of your script from working as intended. not totally sure why it would work locally if that's not included, but you could have jquery auto-loaded in some way on your local instance; not sure.

@vankishdelfuturo
Copy link
Author

Hey @thesublimeobject, thanks for your previous suggestion. I've added the jQuery script to my HTML file as you recommended:

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
  <script src="assets/js/main.js"></script>

However, I'm still experiencing the same issue - the filtering buttons work fine on localhost but not on the server. I've double-checked, and there are no console errors related to jQuery not being defined anymore. It's also worth noting that the masonry style of the gallery is working, but not the filtering, so it's not like the whole thing is broken.

Do you have any other ideas what might be causing this? Maybe something specific to how scripts behave differently on a server versus localhost? I'd really appreciate any further insights or debugging steps you could suggest. Thanks again for your help!

@thesublimeobject
Copy link
Collaborator

@vankishdelfuturo — you also seem to have not included the script for imagesloaded: Uncaught TypeError: $(...).imagesLoaded is not a function, and this line is directly before the listeners on the portfolio menus that would have them filter. this is likely the issue as far as i can tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants