$('#loadHere').load('https://www.google.com');
- At present, this loads the Google homepage in <div id="loadHere"></div>
.
What I would like to do is somehow store that output as an HTML string in a var
instead.
Pseudo-code:
var googleString = parseString($.load('https://www.google.com'));
When googleString
is output, it would spit out <html>...<head>...<body>...</html>
.
Is this possible?
My ultimate intention is to search through the string
for a particular id
.
Thank you kindly.
Index.html:
<!--snip-->
<script src="https://.... jQuery file"></script>
<div id="loadHere"></div>
<script src="changePage.js"></script>
<!--snip-->
changePage.js
$(document).ready(function(){
$('#loadHere').load('https://www.google.com');
}
[Edit] - Included snippets of the two files.