A user on my website will enter a url (a public page on another domain) in a textbox
. I want to fetch the HTML source code that page as a string. How to do this using client side scripting ?
Following is what I did to load url. But not able to figure out how to fetch html.
<!DOCTYPE html>
<head>
<script>
function myFunction()
{
document.getElementById("site").src=document.getElementById("web").value;
}
</script>
</head>
<body>
<input id="web" type="text" name="user">
<input type="submit" value="Submit" onclick="myFunction()"> <br/>
<iframe id="site" src="" width="1200" height="1200"></iframe>
</body>
</html>