title: Creating javascript objects from different files
body: <p>I've been trying to do javascript for sometime now, but i want it to be "object-orientated" so I'm trying to create different javascript classes in different files and try to create an object and call it's methods in a different file function, but it doesn't seem to work.</p>
  
  <p>This is what I have so far:</p>
  
  <h2>person.js</h2>
  
  <pre><code>function Person(name, age, gender)
  {
      this.age = age;
      this.name = name;
      this.gender = gender;
  
      this.job;
  
      this.setJob = function(job)
      {
          this.job = job;
      }
  
      this.getAge = function()
      {
          return this.age;
      }
  
      this.getName = function()
      {
          return this.name;
      }
  
      this.getGender = function()
      {
          return this.gender;
      }
  }
  </code></pre>
  
  <h2>Job.js</h2>
  
  <pre><code>function Job(title)
  {
      this.title = title;
      this.description;
  
      this.setDescription = function(description)
      {
          this.description = description;
      }
  }
  </code></pre>
  
  <h2>main.js</h2>
  
  <pre><code>function  main()
  {
      var employee = new Person("Richard", 23, male);
      document.getElementById("mainBody").innerHTML = employee.getName();
  }
  </code></pre>
  
  <h2>index.html</h2>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;HTML&gt;
  &lt;head&gt;
      &lt;title&gt;javascript test&lt;/title&gt;
      &lt;script src="main.js" type="javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;p id="mainBody"&gt;&lt;/p&gt;
  &lt;/body&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>any help or advice would be greatly appreciated.</p>
  
  <p>Many thanks</p>
  
  <p>EDIT:
  Many thanks for all the answers and suggestions, however, I've included all my javascript files and still it doesn't work...</p>