if i load('mypage.htm') into <div id="placeMyContentHere">

do i need to put JQuery in "mypage.htm". I'm using color box ( of light box ike) on my child page. If i add jquery.js & colorbox.js into mypage.htm it works. Though i can't helping thinking there is better way.

Here is how i normally call colorbox

$(document).ready(function() {

Was it helpful?


Use load's callback function to re-initialise colorbox, there is no need for a $(document).ready(... in the content you are injecting into your div, e.g.:

$("#placeMyContentHere").load('mypage.htm', function() {


You don need to include jquery and colorbox in child page. You are changing the DOM object therefore use jquery live


No, you should only include your javascript libraries (jQuery and plugins) once; on the main page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow