# jQuery - uncaught reference error!

**URL:** <https://forum.kirupa.com/t/jquery-uncaught-reference-error/328280>\
**Category:** web dev\
**Created:** [May 3, 2012, 5:15pm UTC](https://forum.kirupa.com/t/jquery-uncaught-reference-error/328280 "2012-05-03T17:15:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [May 3, 2012, 5:15pm UTC](https://forum.kirupa.com/t/jquery-uncaught-reference-error/328280/1 "2012-05-03T17:15:44Z")

</div>

Ughhhh Annoying… I am using jQuery - and it’s not working for me. Very simply I define a function, and call it. Alas - no - I get the uncaught reference error. Maybe I have done something very stupid - but I cant see it.

THE CODE:

```auto
function typer() {	// my code
};
var muse = setTimeout('typer()',500); // uncaught reference error!

```

SO it’s all about where is the jQuery and how it is being initialised … well ive tried it all …  
for starters, im loading it at the very end of my code via a ‘script.js’, just above the … nd ive tried the following

```auto
$(document).ready(function () {// my code
});

```

// U R E

```auto
(function($) {// my code
})(jQuery);

```

// U R E

```auto
(function() {// my code
})();

```

// U R E

Banana’s! they should all work \>… IF I just put the code in script tags - then it works …  
Any ideas?!
