Http_request = new XMLHttpRequest;
....
document.getElementById (reobj). InnerHTML = Http_request.responsetext;
Now that ResponseText is returning the entire HTML, how can I get it to return the contents of my specified tag?
Note: What template, the framework is not used, just loaded a xmlajax.js file in index.php. The above code, in Xmlajax.js, gets the entire HTML code for index.php. How to get the contents of the specified label instead of the entire HTML code!!!
Reply to discussion (solution)
All you have to do is go back to what you need.
is to return only what is needed, the key is how to get responsetext to return only what is needed?
is the URL you requested to be index.php? Return what you need on the server.
Access index.php with Ajax in index.php? The files you access will all be output
Access index.php with Ajax in index.php? The files you access will all be output
Just because all the output, I need not all output, as long as the output part. Can it be solved with regular? If you can, ask the great gods to write a code that matches the entire HTML ... The content in and returns:
Preg_match ("/]+id= ' _ajax ' [^>]*> (. *) <\/div>/is", $str, $arr);
Print_r ($arr [1]);
Aren't you giving yourself trouble?
document.getElementById (reobj). InnerHTML = Http_request.responsetext;
document.getElementById (reobj). InnerHTML = document.getElementById (reobj). getElementById (' _ajax '). InnerHTML
Aren't you giving yourself trouble?
document.getElementById (reobj). InnerHTML = Http_request.responsetext;
document.getElementById (reobj). InnerHTML = document.getElementById (reobj). getElementById (' _ajax '). InnerHTML
I'm not very clear about it. Reobj is _ajax.
Passing ~~~~~~~~~~~ Understand the
So why don't you responsexml, let index.php generate an XML file, and then read the contents of the desired node with the Javascrip Dom!
Regular match
index.php
Can you control the requested file? If you can control what you're going to get back inside.
Pass by, study in ...
Now encountering the same problem
The same problem is now encountered. Distress