Replace Javascript code and run it
<p>Suppose I have this code:</p>

<pre><code>my_script_data = document.getElementById("id_php_defer__core");
if (my_script_data == undefined) {
  Alert(request.responseText); // all looks good!
  my_script_data = document.createElement("script");
  my_script_data.setAttribute("id", "id_php_defer__core");
  my_script_data.innerHTML = 'function myinitfunc() { ' + "\n" + request.responseText + "\n" + ' }';
  to = document.head;
  if (to != undefined) {
    to.appendChild(my_script_data);
  }
}
else {
  Alert(request.responseText); // all looks good!
  my_script_data.innerHTML = 'function myinitfunc() { ' + "\n" + request.responseText + "\n" + ' }';
  eval(my_script_data.innerHTML);
}
</code></pre>

<p>The "request.responseText" is actually a Javascript array declaration with lots of values set.</p>

<p>After above code, the "myinitfunc" is called later.</p>

<p>(And as it should only contain "request.responseText" the global (!) array of values should be updated.)</p>

<p>However, while the code works on first run, subsequent runs seem to do nothing, so I am doing something wrong, but what? :)</p>
