Created
February 21, 2016 11:53
-
-
Save Yves-T/40466574de9645f79ebc to your computer and use it in GitHub Desktop.
JQUERY: load templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1 id="testHeader">BLABLA</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> | |
<style> | |
#testHeader { | |
color: tomato; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="selectedTarget"> | |
Existing content. | |
</div> | |
<script type="text/javascript"> | |
$(document).ready(function () { | |
$('#selectedTarget').load('includes/contentSnippet.html'); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment