title: Implement javascript/jquery file into wordpress
body: <p>I have an HTML site, that I need to implement into Wordpress.</p>
  <p>Now I have problems to get the functions to start.</p>
  <p>I have the Avada theme activated and paste the inline js code with the &quot;code block&quot; element into the site. The inline js is wrapped into <code>$(document).ready(function () { });</code> and calling an object with <code>object = new Object(options, options);</code>. Until here everything works fine, but then I get an error in the additionally js file.</p>
  <p>The structure in the additionally file is as follows:</p>
  <pre><code>class 1 {
  }
  class 2 {
  }
  class Object {
    constructor {}
    function {}
    function {}
    and so on
  }
  </code></pre>
  <p>And in that file I'm getting an <code>Uncaught TypeError: Cannot read property 'extend' of undefined</code>.</p>
  <p>This is the row:</p>
  <pre><code>this.options = $.extend({}, defaultOptions, options);
  </code></pre>
  <p>I'm pretty sure it's because of the jQuery.</p>
  <p>The file is added with the following function</p>
  <pre><code>wp_register_script('custom-script', get_stylesheet_directory_uri() . '/script.js', array('jquery'), '1.11.2', true);
  </code></pre>
  <p>I don't know if it's better to wrap everything with jQuery and how to do it or to replace the jQuery things with plain javascript?</p>