here is an example, say every item in each list was clicked on http://katproxy.com/the-big-bang-theory-tv8511/, how would you proceed to get the source code of the modified web page using php considering the fact that the url has not changed (file_get_contents is probably out of the question). Thank you!
Asked
Active
Viewed 95 times
-5
-
1Short of AJAXing the entire DOM tree, it's impossible. The server can't know the state of the client without being explicitly told. By the way, don't AJAX the entire DOM tree to the server for every change you make to the DOM, you'll murder the server's bandwidth – GordonM Oct 30 '13 at 18:46
-
Only practical way would be to run an ajax with html retrieved from javascript (http://stackoverflow.com/questions/817218/get-entire-document-html-as-string) – Robin Castlin Oct 30 '13 at 18:47
1 Answers
3
Using PHP? You can't, not without fetching the page source and evaluating its JavaScript, which is obviously quite impractical.
The "page" hasn't change, only your in-browser representation of the DOM has been modified. You would need PHP to talk to your browser, and ask for the state of its DOM, not the remote server, which cannot possibly serve up the HTML representation of your browser's current DOM.

user229044
- 232,980
- 40
- 330
- 338