How to make a html page to show content from another url
An iframe sounds like it may be what you need, but I'm not 100% sure after reading your description. The iframe will show content from another URL in your page. Once you have that all you need to do is style the page and use CSS/JavaScript to add in your functionality as described.
Check out this:
http://www.w3schools.com/tags/tag_iframe.asp
Load a HTML page within another HTML page
iframe
is the tag which you can use for call other html pages into your web page
<iframe
src="http://www.google.co.in"
name="targetframe"
allowTransparency="true"
scrolling="no"
frameborder="0"
>
</iframe>
Getting a link to go to a specific section on another page
I believe the example you've posted is using HTML5, which allows you to jump to any DOM element with the matching ID
attribute. To support older browsers, you'll need to change:
<div id="timeline" name="timeline" ...>
To the old format:
<a name="timeline" />
You'll then be able to navigate to /academics/page.html#timeline
and jump right to that section.
Also, check out this similar question.
Is there a way to display a html page both in another page and with its own URL?
Use {% include %}
template tag (doc). This will allow you to use the a common html snippet from two different templates.
You can combine both {% extends %}
and {% include %}
tags as necessary.
Alternatively, it is possible to do the composition in the client side with a little bit of JavaScript, AJAX/Fetch request, and <iframe>
tag. Client side rendering may be desirable in some circumstances, as it produces better rendering isolation, so scripting and styling are cleaner and more reliable. But the drawback is also that the rendering in iframe are completely isolated, so scripting and styling between pages may become trickier if you need to do more than just displaying content.
Include another HTML file in a HTML file
In my opinion the best solution uses jQuery:
a.html
:
<html>
<head>
<script src="jquery.js"></script>
<script>
$(function(){
$("#includedContent").load("b.html");
});
</script>
</head>
<body>
<div id="includedContent"></div>
</body>
</html>
b.html
:
<p>This is my include file</p>
This method is a simple and clean solution to my problem.
The jQuery .load()
documentation is here.
Get content from another page with JavaScript
You can use a combination of JavaScript, jQuery, and AJAX to accomplish this.
First, include the jQuery library:
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
Then write a JavaScript function similar to this one which will replace your div element's html content with the Page2.html file:
var loadNewContent = function {
$.ajax("Page2.html", {
success: function(response) {
$("#content2").html(response);
}
});
};
And then you would need some 'trigger' to run this function such as this:
$("#content2").on('click', loadNewContent);
Hope this helps.
How can I view a part of an other website on my website?
<div id="ab"><iframe src="//hodekar.tk"></iframe></div>
and this css#ab {
display : block;
overflow : hidden}
iframe{
margin: -50px -60px}
use minus margin so it will goes in that div and unuseful content will not be displayed in webpage. specify height of div and iframe
Related Topics
Display Text on Mouseover for Image in HTML
Border Around Specific Rows in a Table
Websocket Server Implementations for Delphi
Right Align Text Within Bootstrap 4 Breadcrumbs
How to Make a Flex Item Not Fill The Height of The Flex Container
How to Make HTML Open a Hyperlink in Another Window or Tab
Disable Chrome Translation Bar on My Website
Force Ie9 to Emulate Ie8. Possible
Can't Get The Complete Address While Uploading a File
How to Upload Multiple Files Using One File Input Element
Jsf Vs HTML(Jsp) for Enterprise Portals UI Layer. Which One to Choose? and Why
Schema.Org/Microdata Markup for List of Recent Posts Without Providing "Author"/"Publisher"
How Organize Pagination with a Large Number of Pages in Django Project
Select Size Attribute Size Not Working in Chrome/Safari
Does Svg Xmlns Attribute Value Requires Protocol? Can It Be Https or Relative