Is there a way with jQuery to load Html contents from a url?
For example:
<div class="MyContent">
<html>
<head>
<title>Hello World Page</title>
</head>
<body>
Hello World
</body>
</html>
</div>
Can I replace all of the HTML above in the div with the content from a URL?
You're looking for
.load()
Firstly, create an HTML page with this code
Have an iFrame inside a DIV (optional) and change the source of the iFrame to URL using jQuery. The url should point to the page you create above.
using
.get()
and.html()
in jQuery. ex,