Skip to content

Instantly share code, notes, and snippets.

@didxga
Created June 14, 2012 19:34
Show Gist options
  • Save didxga/2932430 to your computer and use it in GitHub Desktop.
Save didxga/2932430 to your computer and use it in GitHub Desktop.
demonstrate $.getScript useage
<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>
<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>
$(document).ready(function() {
alert($('#featured').html());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment