title: Open Source Spell Check for javascript Typo.js
body: <p>As I try to use the typo.js spell checker in my file. But it's throw some error's I can't find the solutions. I just followed the Typo.js Documentation Here is the document link.
  <a href="https://github.com/cfinke/Typo.js/" rel="nofollow noreferrer">https://github.com/cfinke/Typo.js/</a>
  Kindly check the below issue and help me to reach out this issue</p>
  <p><a href="https://i.stack.imgur.com/4EEYa.png" rel="nofollow noreferrer">Here is the console issue image</a></p>
  <p>Here is the used code</p>
  <p><strong>JS</strong></p>
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;title&gt;Typo.js Example&lt;/title&gt;
      &lt;meta charset=&quot;UTF-8&quot; /&gt;
      &lt;script type=&quot;text/javascript&quot; src=&quot;typo/typo.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js&quot;&gt;&lt;/script&gt;
      &lt;script type=&quot;text/javascript&quot;&gt;
          var dictionary = new Typo(&quot;en_US&quot;, false, false, { dictionaryPath: &quot;typo/dictionaries&quot; });
  
          // function load() {
          //     $('#loading-progress').append('Loading affix data...').append($('&lt;br /&gt;'));
  
          //     $.get('typo/dictionaries/en_US/en_US.aff', function (affData) {
          //         $('#loading-progress').append('Loading English dictionary (this takes a few seconds)...').append($('&lt;br /&gt;'));
  
          //         $.get('typo/dictionaries/en_US/en_US.dic', function (wordsData) {
          //             $('#loading-progress').append('Initializing Typo...');
  
          //             dictionary = new Typo(&quot;en_US&quot;, affData, wordsData);
  
          //             checkWord('mispelled');
          //         });
          //     });
          // }
  
          checkWord('mispelled');
  
          function checkWord(word) {
              var wordForm = $('#word-form');
              wordForm.hide();
  
              var resultsContainer = $('#results');
              resultsContainer.html('');
  
              resultsContainer.append($('&lt;p&gt;').text(&quot;Is '&quot; + word + &quot;' spelled correctly?&quot;));
  
              var is_spelled_correctly = dictionary.check(word);
  
              resultsContainer.append($('&lt;p&gt;').append($('&lt;code&gt;').text(is_spelled_correctly ? 'yes' : 'no')));
  
              if (!is_spelled_correctly) {
                  resultsContainer.append($('&lt;p&gt;').text(&quot;Finding spelling suggestions for '&quot; + word + &quot;'...&quot;));
  
                  var array_of_suggestions = dictionary.suggest(word);
  
                  resultsContainer.append($('&lt;p&gt;').append($('&lt;code&gt;').text(array_of_suggestions.join(', '))));
              }
  
              wordForm.show();
          }
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;h1&gt;Typo.js Demo&lt;/h1&gt;
      &lt;p&gt;This page is an example of how you could use &lt;a href=&quot;http://github.com/cfinke/Typo.js&quot;&gt;Typo.js&lt;/a&gt; in a webpage
          if you need spellchecking beyond what the OS provides.&lt;/p&gt;
      &lt;p id=&quot;loading-progress&quot;&gt;&lt;/p&gt;
      &lt;div id=&quot;results&quot;&gt;&lt;/div&gt;
      &lt;form method=&quot;GET&quot; action=&quot;&quot; onsubmit=&quot;checkWord( document.getElementById( 'word' ).value ); return false;&quot;
          id=&quot;word-form&quot; style=&quot;display: none;&quot;&gt;
          &lt;p&gt;Try another word:&lt;/p&gt;
          &lt;input type=&quot;text&quot; id=&quot;word&quot; value=&quot;mispelled&quot; /&gt;
          &lt;input type=&quot;submit&quot; value=&quot;Spellcheck&quot; /&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>