February 29, 2012
Get HTML source code as a string
Question by user1196522
I want the source code of an HTML page (1.html
) to be used in another page (2.html
). Further, I want to perform operations on it in 2.html
.
Is there a way to do this?
EDIT: 1.html
is a seperate public webpage and I do not have access to make changes to its source code. I have to do whatever I need only by using 2.html
.
Answer by Starx
Its very simple
On 2.html
use this jQuery snippet
$.get("1.html", function(response) {
alert(response)
//do you operations
});