title: passing data from an html page to another in javascript
body: <p>I know this question was asked many times, but after reading the answers, and trying some solutions, my code  still doesn't work.
  Here are my working files :</p>
  
  <pre><code>my_app
     -index.html
     -task1
         -index.html
  </code></pre>
  
  <p>In my_app/index.html, I declare an array , that I have to send to task1/index.html</p>
  
  <pre><code>testArray =[1, 2, 3];
  
      var myUrl= "task1/index.html";
            $.ajax({
                  type: "POST",
                  url: myUrl,
                  dataType: "json",
                  data: JSON.stringify({images:testArray}),
                  success: function (data) {
                  console.log('success');
                      alert(data);
                  }
              });
               window.open(myUrl); 
  //this code is called when a radio button is checked
  </code></pre>
  
  <p>The new window which points to the right url opens, but the testArray isn't sent.
  I got 2 errors: </p>
  
  <pre><code>1/ Origin null is not allowed by Access-Control-Allow-Origin.
  2/the variable images is not defined when I try to access it from task1/index.html
  </code></pre>
  
  <p>For the 1st error, I read that this may be caused by Google Chrome's restriction when it comes to use Ajax with local resources.
  As suggested here <a href="https://stackoverflow.com/questions/8456538/origin-null-is-not-allowed-by-access-control-allow-origin">Origin null is not allowed by Access-Control-Allow-Origin</a>, I added </p>
  
  <pre><code>--allow-file-access-from-files
  </code></pre>
  
  <p>in Google Chrome properties. But the path was not accepted (I had a pop-up window "path not correct").</p>
  
  <p>What is weird is that I tried to run the code with FireFox, I still have error 2</p>
  
  <p>Is anything missing in my Post Ajax request? Is it possible to use Ajax to send data between 2 html files ?(I don't have any client/server side app here)</p>
  
  <p>Thanks!</p>