-1

I've done every things, but i get Uncaught TypeError: $ is not a function on my weebly site!

My Code:

setTimeout(function() {
$(".popup-wrap").on("click", function() {
    $(".popup-wrap .popup").hide();
    $(".next-popup").show("slow");
});
}, 4000);

HTML:

<div class="popup-wrap">
<div class="popup">
<b>Get your free</b> 999.9% <b>Gold Bullion</b> Cash Gold!
</div>

<div class="next-popup" style="display: none;">
Almost Done! Complete Free Affiliate Registration to receive Cashgold!
</div>
</div>

I'm unable to understand, why this happen, please help :)

Kirk Beard
  • 9,569
  • 12
  • 43
  • 47
Aariba
  • 1,174
  • 5
  • 20
  • 52

3 Answers3

3

Include jQuery in your project. That will solve your problem.

Here is how you can do this.

<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
kvn
  • 2,210
  • 5
  • 20
  • 47
3

first include your jquery script

Hoque MD Zahidul
  • 10,560
  • 2
  • 37
  • 40
1

Before calling the $ you need to add the jquery script.Because $ is not defined in normal javascript it's a library method of jquery. You can download the script from this link. Then add in your project Example :

<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> .Or you can use cdn from here

Hoque MD Zahidul
  • 10,560
  • 2
  • 37
  • 40