Page 1 of 1

Copy source code of a webpage

Posted: Wed Feb 24, 2010 12:40 am
by sanju
Hi all,

I have a dynamic newsletter template and I need to copy the source code of this webpage with a click of a button and need to save it for sending the emails. How can i do that,


Any one pls help

Re: Copy source code of a webpage

Posted: Wed Feb 24, 2010 2:17 pm
by pickle
The only way I can think of is using an AJAX request to ask for the code again. You have to do a new request because that's the only way to get the code as a string. Browsers convert it into the DOM and may do some modification to the code. Once you have the code again, I'm pretty sure Javascript can access the clipboard somehow.

Re: Copy source code of a webpage

Posted: Wed Feb 24, 2010 2:30 pm
by AbraCadaver
What programming languages are available? PHP? Where is the template? Where do you want to save it, in a variable, in another file?