본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

Uncaught TypeError: $(...).slick is not a function

  • 6 답장
  • 1 이 문제를 만남
  • 20 보기
  • 최종 답변자: Matej

more options

Hello everyone.

I am currently working on a website kokolingo.hr

I have a slick-slider function inside of it which will create a slider with images: Slick slider

Now the issue is that right now, the slick-slider only breaks on Firefox and it looks like this MOST of the time: Broken slick slider

On top of that, while doing a force reload (CTRL + F5) it can sometimes load slick-slider without any issues and it doesn't throw an error. Both of the images were taken from Firefox itself.

How can I fix this? Most of the time people say that the libraries which make use of the slick-slider aren't loaded in correct order but they are.

If you need more information, simply ask what you need and I will try to deliver.

Matej

Hello everyone. I am currently working on a website kokolingo.hr I have a '''slick-slider''' function inside of it which will create a slider with images: [https://imgur.com/a/a24uENA Slick slider] Now the issue is that right now, the slick-slider only breaks on Firefox and it looks like this MOST of the time: [https://imgur.com/a/7NHQluv Broken slick slider] On top of that, while doing a force reload (CTRL + F5) it can sometimes load slick-slider without any issues and it doesn't throw an error. Both of the images were taken from Firefox itself. How can I fix this? Most of the time people say that the libraries which make use of the slick-slider aren't loaded in correct order but they are. If you need more information, simply ask what you need and I will try to deliver. Matej

모든 댓글 (6)

more options

It looks like your slick library is not ready at the time of using it. Try to move this script to the header.

more options

TyDraniu said

It looks like your slick library is not ready at the time of using it. Try to move this script to the header.

Nope, still doesn't work ://

more options

I've managed to get it to work a few times with a normal refresh (F5) and then all the sliders work.

more options

Odd timing issues can occur when script files are loaded from cache, but it's puzzling that the script is not recognized as having been read when hitting line 1990, the $(document).ready event handler. Or perhaps I should say that a different way: why is the script loaded and ready when bypassing the cache, but seldom ready when reloading the page from cache? It seems DOMContentLoaded (which I think is the event that jQuery .ready() hooks) has a different meaning for cached pages. ??

more options

cor-el said

I've managed to get it to work a few times with a normal refresh (F5) and then all the sliders work.

That is what is bugging my mind the most. Why does it work sometimes and sometimes doesn't?

more options

jscher2000 said

Odd timing issues can occur when script files are loaded from cache, but it's puzzling that the script is not recognized as having been read when hitting line 1990, the $(document).ready event handler. Or perhaps I should say that a different way: why is the script loaded and ready when bypassing the cache, but seldom ready when reloading the page from cache? It seems DOMContentLoaded (which I think is the event that jQuery .ready() hooks) has a different meaning for cached pages. ??

You might be onto something, I did edit my .htaccess file to cache/store JS files also. Maybe that is the issue? But again, in theory, wouldn't it then be the same for other browsers as well?

EDIT: Tried removing the .js extension so the cache wouldn't store .js files, but nothing changed sadly.

글쓴이 Matej 수정일시