title: Put image array from $_SESSION inside a div in javascript using for loop
body: <p>i have a jquery image uploader that opens in a fancybox.
  When the images are uploaded, a session array with the image names will be created and the pictures will show on the next page after the form was submitted.</p>
  
  <p>I need to show the images at the first page after close the fancybox.
  My idea is to use the session array inside javascript and create a div for every image and put them into my parent div that has the ID "uploaded_pics".</p>
  
  <p>Is there a better way or can someone help me with my code?</p>
  
  <pre><code>var img_arr = "&lt;?php echo $_SESSION['UPLOADED_PICTURES'];?&gt;";
  
  for (var single_img of img_arr) {
  var new_div = document.createElement("div");
  element.appendChild(document.createTextNode("&lt;?php echo $uploaded_path . session_id() . '/' . ;?&gt;"single_img));
  document.getElementById('uploaded_pics').appendChild(element);
  }  
  </code></pre>