is it possible to evaluate JavaScript code using XMLHttpRequest

Posted by user1064717 on Stack Overflow See other posts from Stack Overflow or by user1064717
Published on 2011-11-25T17:43:29Z Indexed on 2011/11/25 17:50 UTC
Read the original article Hit count: 171

Filed under:
|
|
|
|

I'm trying to use this ajax request to call a file with some php which is working ok and some JavaScript which is not. any ideas?

function showpart2(){
if(window.XMLHttpRequest){
  xmlhttp = new XMLHttpRequest();
  xmlhttp.open("GET","atuamae.org/parte2-encomendar.php",false);
  xmlhttp.send(null);
}

document.getElementById('part2').innerHTML = xmlhttp.responseText;
eval(xmlhttp.responseText.getElementById('part2').innerHTML)

setTimeout('showpart2()',15000);

}

showpart2();
</script>

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript