# Html5 Uncaught ref error

**URL:** <https://forum.kirupa.com/t/html5-uncaught-ref-error/331236>\
**Category:** web dev\
**Created:** [June 18, 2013, 7:11pm UTC](https://forum.kirupa.com/t/html5-uncaught-ref-error/331236 "2013-06-18T19:11:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![na\_il](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@na\_il](https://forum.kirupa.com/u/na_il)\
**Post date:** [June 18, 2013, 7:11pm UTC](https://forum.kirupa.com/t/html5-uncaught-ref-error/331236/1 "2013-06-18T19:11:43Z")

</div>

I’m trying to learn html5 and js, so I’m following a tutorial and when i try to call the javascript file it obviously isn’t called… why is this? I followed the tutorial exactly but can’t achieve the same results. The html and js file are in the same folder so what gives?

Here is html

```auto

<!doctype html>
<html lang="en">
    
    <head>
        
        <title>HTML5 Example</title>

        <script type="text/javascript" src="person2.js"></script>
        <script type="text/javascript">

            function init() {
                var lee = new Person("cool_guy", "3445 market street")
                lee.sayHello();
                console.log(lee);
            }

        </script>

    </head>

    <body onload="init()">
        
        
        
    </body>

</html>

```

here is javascript

```auto

(function(window) {

    function Person(name, address) {
        this.name = name;
        this.address = address;
    }

    Person.prototype.sayHello = function() {
        console.log(this.name + " says hello");
    };

    Person.SPECIES = "human";

}(window));

```
