|
| ||||||||||
| Tags: html, php, xml |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to retrieve Response from HTML and PHP pages
I am trying to invoke js code that submit parameter to php page , but the result that the XMLHttpRequest Object captures is all the html of the page + the result from the php , Is I am wrong in this code? Code: var rqo;
function setReq(v) {
if (v != "") {
document.getElementById("result").innerHTML = "Fetching " + v;
rqo = new XMLHttpRequest();
var qs = encodeURIComponent(v);
var qry = "index.php?_data_input=" + qs;
rqo.open('GET',qry,true);
rqo.onreadystatechange = handleHttpResponse;
rqo.send(null);
return false;
}
}
function handleHttpResponse() {
var results = "";
qq (rqo.readyState == 4) {
results = rqo.responseText;
document.getElementById("result").innerHTML = results;
}
}
.....
....
<div class="c3" id="result">
</div>
....
<form method="get" name="_main_form" >
<input type="text"size="50" name="_data_input" id="_data_input">
<input type="button" value="Get Item" onclick="aboutlang(document._main_form._data_input.value)">
</form>
..... |
|
#2
| |||
| |||
| Re: How to retrieve Response from HTML and PHP pages
If you don't want PHP to do something then you have to prevent it from doing that. Once it's printed the result you want you don't want it to continue, right? So don't let it continue. Here's a hint: exit will stop execution dead in its tracks. |
|
#3
| |||
| |||
| Re: How to retrieve Response from HTML and PHP pages
im not sure that technically its the right thing to do i just what using XMLHttprequest to catch the response from php the "<br> dddddddd </br>" string and innerHTML it to the result div but now its innerHTML all the page including the result to the result div. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to retrieve Response from HTML and PHP pages" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can I upload my html pages using filezilla | lovecraft | Technology & Internet | 1 | 24-03-2012 04:37 PM |
| how SSI technique use in html pages | Bansi_WADIA | Software Development | 4 | 28-01-2010 02:11 AM |
| How to add links to other pages in HTML | Camdean | Software Development | 5 | 19-01-2010 02:41 PM |
| Java program to retrieve html source | Aaliya Seth | Software Development | 5 | 12-01-2010 10:59 AM |
| Retrieve the response with POST | Happy46 | Software Development | 3 | 05-12-2009 08:20 PM |