Use jQuery and the .load()
( http://api.jquery.com/load/
) method to inject the loaded document into the DOM.
$(function() {
$('#content').load('/templates.html');
});
More Related Contents:
- How to separate web components to individual files and load them?
- Opening new window in HTML for target=”_blank”
- How to create a translucent in React Native?
- How do I create an HTML element with attributes and events using JavaScript?
- How to get value of selected radio button?
- How to show the “Are you sure you want to navigate away from this page?” when changes committed?
- How to get a file or blob from an object URL?
- Render basic HTML view?
- Animate element to auto height with jQuery
- Method to show native datepicker in Chrome
- How can I let a user download multiple files when a button is clicked?
- Limit number of lines in textarea and Display line count using jQuery
- Add/remove HTML inside div using JavaScript
- Capture frames from video with HTML5 and JavaScript
- How to auto-scroll to end of div when data is added? [duplicate]
- change src with javascript
- How do you listen / detect changes to an input value – when the input value is changed via javascript?
- Value was evaluated just now with console.log on JavaScript object
- Adding rows dynamically with jQuery
- How to make supported on all browsers? Any alternatives?
- Updating source URL on HTML5 video with React
- Running Javascript in new window.open
- Get value of a custom attribute
- CSS Textarea that expands as you type text [duplicate]
- JavaScript to get rows count of a HTML table
- How can I make an image carousel with only CSS?
- HTML5 Drag and Drop – No transparency?
- How to use pagination on HTML tables?
- Geolocation closest location(lat, long) from my position
- Pass element ID to Javascript function