Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX and Javascript not working
    primarykey
    data
    text
    <p>NO JQUERY. I am using peoplecode which is similar to JSP, ASP, and ZXZ. The ajax request is triggered am I am trying to pull the text 'Hello World' from this script...</p> <pre><code>Function IScript_AJAX_Test() %Response.Write("&lt;div id='hello'&gt;Hello World&lt;/div&gt;"); End-Function; </code></pre> <p>My javascript function that makes the ajax call looks like this...</p> <pre><code>function AJAX_test (ajax_link) { if (typeof XMLHttpRequest == 'undefined') { XMLHttpRequest = function() { try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch(e) {} try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch(e) {} try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {} try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} throw new Error('This browser does not support XMLHttpRequest or XMLHTTP.'); }; } var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (request.readyState == 4 &amp;&amp; request.status == 200) { document.getElementById('ajax').innerHTML = request.responseText.document.getElementById('hello').innerHTML; //document.getElementById('ajax').innerHTML = 'Testing'; } } request.open('GET', ajax_link, true); request.send(); //document.getElementById('ajax').innerHTML = ajax_link; } </code></pre> <p>As you can see in this line..</p> <pre><code>document.getElementById('ajax').innerHTML = request.responseText.document.getElementById('hello').innerHTML; </code></pre> <p>...I am trying to grab the text by getting the innerHTML from the id. This isn't working though. When I click the button nothing happens. </p> <p>I tried using the line below, but it returns an entire new page where the id would be (probably because of Peoplesoft)...</p> <pre><code>document.getElementById('ajax').innerHTML = request.responseText; </code></pre> <p>Can someone help me achieve this...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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