Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How do I get a fragment to load from an unspecified html?
- <div id="header">
- <h1>N300 Project Gallery</h1>
- </div>
- <div id="container">
- <div id="utility">
- <ul>
- <li><a href="about.html">About</a></li>
- <li><a href="projects.html">Projects</a></li>
- </ul>
- </div>
- <div id="index-content">?</div>
- <div id="footer">This is the footer</div>
- </div>
- $(document).ready(function() {
- $('#utility a').click(function(e){
- e.preventDefault();
- $('#utility').hide('normal',loadContent);
- });
- function loadContent() {
- $('#index-content').load(url+ '#content')
- }
- });
- <div id="content">
- <p>Hello! My name is Brittany Shephard.</p>
- </div>
- function loadContent() {
- $('#index-content').load($(this).attr('href')+ ' #content');
- }
- $(document).ready(function() {
- $('#utility a').click(function(e){
- e.preventDefault();
- $('#utility').hide('normal', function() {
- loadContent($(e.target).attr('href'));
- });
- });
- function loadContent(url) {
- $('#index-content').load(url + ' #content');
- }
- });
Add Comment
Please, Sign In to add comment