title: Search for a string from a text file in java script
body: <p>I am creating a Dictionary app for mobile using Java Script. I have stored Dictionary source in a separate file. My doubt is how to access that file and search for particular string using Java Script. </p>
  
  <pre><code>function dic() {
      var word = document.getElementById("wo").value;
      var dictionary = new Array("Java","Python","Swift","HTML","PHP");
      var flag = 0;
      for(var i = 0; i &lt; dictionary.length; i++) {
          if(dictionary[i] == word) {
              document.getElementById("result").innerHTML = "Element Found";
              flag = 1;
              break;
          }
      }
      if(flag == 0)
          document.getElementById("result").innerHTML = "Element Not Found";  
  
  }
  </code></pre>
  
  <p>This script checks for the word in array. I want to replace the array words to a text file. Thanks in advance </p>