7blake Posted April 21, 2015 Share Posted April 21, 2015 Hi. Not too sure how to word this right. I remember once when I was learning how to send javascript variables to PHP, I accidentally sent a capture of the entire index.php.Ive been trying to find the answer online but I guess im not wording it right. Does anyone know how to do this? Quote Link to comment Share on other sites More sharing options...
Solution maxxd Posted April 21, 2015 Solution Share Posted April 21, 2015 It sounds like you're looking for information on AJAX. You can send information from JavaScript to php, process it on the server side in php, and return data to your client-side JavaScript. Here's information on using JQuery - it makes AJAX calls easier to deal with. 1 Quote Link to comment Share on other sites More sharing options...
7blake Posted April 21, 2015 Author Share Posted April 21, 2015 Thanks alot, got the ball rolling So incase anyones new and interested too, to capture the dynamic state of the HTML you only need var x = $("body").html(); alert(x); To capture the saved state of a file and send via aJax $.ajax({ url: "fileName.php", type: "POST", dataType: "text", success: function(data) { alert(data); } }); I'm not sure how to capture dynamic variables in Javascript though. I suppose it just needs a script to update an array, then send the array that way.Thanks for the info maxxd Quote Link to comment Share on other sites More sharing options...
IThinkMyBrainHurts Posted April 21, 2015 Share Posted April 21, 2015 (edited) Wouldn't this only get the Body section and not the whole page? var x = $("body").html();EDIT:Here's how to get the lot, depending on how much: http://stackoverflow.com/questions/982717/how-do-i-get-the-entire-pages-html-with-jquery Edited April 21, 2015 by IThinkMyBrainHurts 1 Quote Link to comment Share on other sites More sharing options...
7blake Posted April 21, 2015 Author Share Posted April 21, 2015 (edited) Ah, my apologies. if I could correct my statement I would. (too late to edit) Thanks iThinkMyBrainHurts Edited April 21, 2015 by 7blake Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.