Created
June 14, 2012 19:34
-
-
Save didxga/2932430 to your computer and use it in GitHub Desktop.
demonstrate $.getScript useage
This file contains 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
<html> | |
<head> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
//do not forget put your code inside onload handler function!!! | |
$("a#1").click(function(){ | |
$("#center_content").load("b.html", function(){ | |
$.getScript("c.js") | |
}); | |
}); | |
}); | |
</script> | |
</head> | |
<a href="#" id="1">load slide</a> | |
<div id="center_content"></div> | |
</html> |
This file contains 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
<div class="row"> | |
<div class="four columns">Welcome</div> | |
<div class="eight columns" id="featured"> | |
<img src="images/slides/1.jpg" alt="Overflow: Hidden No More" /> | |
<img src="images/slides/2.jpg" alt="HTML Captions" /> | |
<img src="images/slides/3.jpg" alt="and more features" /> | |
<img src="images/slides/1.jpg" alt="Overflow: Hidden No More" /> | |
<img src="images/slides/2.jpg" alt="HTML Captions" /> | |
<img src="images/slides/3.jpg" alt="and more features" /> | |
</div> | |
</div> |
This file contains 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
$(document).ready(function() { | |
alert($('#featured').html()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment