-3

I've realized a random function to set different logo every time you refresh page:

https://jsfiddle.net/py3ttdc2/

But the browser console show this error:

(index):268 Uncaught TypeError: $ is not a function
    logoRandom  @   (index):268
    (anonymous function)    @   (index):265

UPDATE

sorry guys, but I wrote the code to show you only the string. This is the website: www.subbbilla.com and this is the jquery inside it <script type='text/javascript' src='subbbilla.com/wp-includes/js/jquery/…;, that was included yet.

  • 1
    You are using jQuery but you haven't loaded the jQuery library in your document. – Turnip Aug 07 '16 at 17:19
  • 1
    Posting a jsFiddle link as code, because it tells you you have to write code if you post a jsFiddle link. You're diabolical... – Nick Bull Aug 07 '16 at 17:20
  • Possible duplicate of [Uncaught ReferenceError: $ is not defined?](http://stackoverflow.com/questions/2075337/uncaught-referenceerror-is-not-defined) – Taylor Daughtry Aug 07 '16 at 17:22
  • Possible duplicate of [TypeError: $ is not a function when calling jQuery function](http://stackoverflow.com/questions/12343714/typeerror-is-not-a-function-when-calling-jquery-function) – Nick Bull Aug 07 '16 at 17:22
  • 1
    Possible duplicate of [JQuery - $ is not defined](http://stackoverflow.com/questions/2194992/jquery-is-not-defined) – Turnip Aug 07 '16 at 17:23
  • sorry guys, but I wrote the code to show you only the string. This is the website: www.subbbilla.com and this is the jquery inside it , that was included yet. – Sergio Vento Aug 08 '16 at 13:28

2 Answers2

0

Answered over and over.

jQuery isn't included, so $ isn't found.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
Nick Bull
  • 8,365
  • 5
  • 22
  • 43
0

Add jquery as following :

enter image description here

After adding jquery

Or if you are working on your local machine :

<script
              src="https://code.jquery.com/jquery-3.1.0.min.js"
              integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s="
              crossorigin="anonymous"></script>
Abdennour TOUMI
  • 64,884
  • 28
  • 201
  • 207