Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to execute a page ,that contains JS ,in AJAX ,using innerHTML?
    text
    copied!<p>I send GET data with AJAX to another file.And on the another file I have <code>echo "&lt;script&gt;alert('Something');&lt;/script&gt;";</code>.This is displayed dynamicly with AJAX ,i.e</p> <pre><code>var ajaxDisplay = document.getElementById('edit'); ajaxDisplay.innerHTML = ajaxRequest.responseText; </code></pre> <p>puts the <code>&lt;script&gt;alert('Something');&lt;/script&gt;</code> to <strong>div with name edit</strong>. But it doesn't alert anything. How to get it work?</p> <p><strong>I have mixed html/javascript.</strong> Here is the code.</p> <pre><code>function ajaxFunctions(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('edit'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } var namef = document.getElementById('nameed').value; var queryString = "?namef=" + namef; ajaxRequest.open("GET", "try.php" + queryString, true); ajaxRequest.send(null); } </code></pre> <p>Maybe to find the <strong>script</strong> tags and to <strong>eval</strong> them? But how to find the <strong>script</strong> tags?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload