var obj = document.getElementById('state'); eval(ajax.response); // Executing the response from Ajax as Javascript code }