title: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMWindow.alert]
body: <p>I am calling an javascript variable inside autocomplete function and and making url in ajax from textbox value but it is showing undefined.</p>
  
  <pre><code>function fetchRecords()
  {
      var searchStr=$("#tags").val();
  
      var finalLink=urlformjavascriptvariable;
      $.ajax({
      url:finalLink,
  
      type: 'GET',
      dataType :'jsonp',
      async: false,
      crossDomain:true,
      success: function(data) {
      var resp = data.response;
      var availableTags = "[";
      for (i = 0; i &lt;= 10; i++) {
          if(resp.messages.message[i].subject.$ != undefined)
              var postSub = resp.messages.message[i].subject.$;
      if (i &lt; 10) {
          availableTags +="\"" +postSub + "\",";
      }
      else {
          availableTags +="\""+ postSub+"\"";
      }
  }
  availableTags += "]";
  availableTags=eval(availableTags);
  
          $("#tags").autocomplete({
              source: availableTags,
  
          });
      }
  });
  }
  &lt;/script&gt;
  
  &lt;div class="ui-widget"&gt;
  &lt;input id="tags" class="input_width mgtop20" autocomplete="on"  onKeyup="fetchRecords();" type="text" name="post_search" value="" placeholder="Search the Community for answers"  /&gt;&lt;/div&gt;
  </code></pre>
  
  <blockquote>
    <p>It shows variables undefined</p>
  </blockquote>