title: Can I use an array in ajax javascript?
body: <p>I'm new with ajax and I want to use an array in ajax.</p>
  
  <p>What I want is:</p>
  
  <ol>
  <li>get data from ajax</li>
  <li>add data to new Array. It's all.</li>
  </ol>
  
  <p><code>$(document).ready(function () { var main_img = new Array()});</code></p>
  
  <p>So, first, I made one new Array and It works very well.</p>
  
  <p>Than I made <code>settings</code> variable for my ajax:</p>
  
  <pre><code>  var settings = {
      "async": true,
      "crossDomain": true,
      "url": "http://localhost:52273/movie",
      "method": "GET",
      "headers": {
        "cache-control": "no-cache",
        "postman-token": "b39e3106-5289-f828-261f-132e1aba7bf7"
      }
    }
  </code></pre>
  
  <p>localhost runs in node server.js and I will get data from html.</p>
  
  <pre><code>  $.ajax(settings).done(function (response) {
      $('#content &gt; div.article &gt; div &gt; div.lst_wrap &gt; ul &gt; li &gt; div &gt; a &gt; img', response).each(function(index)
      {
        var k = $(this).attr('src');
        var k2 = k.slice(0, k.indexOf('?'));
        var alt = $(this).attr('alt');
  
        main_img[index] = k; // this is not working!!!
      });
    });
  </code></pre>
  
  <p>setting and ajax run on <code>document.ready</code>,</p>
  
  <p>and I test insert value in out of ajax, it works very well..</p>
  
  <p>So I thought something is wrong when I use an array in ajax.
  Please Help me...</p>
  
  <p>Is there anything I am missing???</p>