Great! It might have been a bit of overkill. I'm assuming that the slideshow script might jerk around the HTML, thus making it advisable to use the:
Code:
$(document).on('event', 'context', function(){});
construct, which finds the links if they're clicked, rather than assigns a click behavior directly to them. And I used the root $.ajax() function on which all of the other jQuery functions like .load(), .get(), etc. are based, both to avoid confusion and to allow for the easy insertion of additional properties. Like perhaps a no cache directive:
Code:
jQuery(function($){
$(document).on('click', '.cj-item a', function(e){
var href = this.href;
$.ajax({
url: href,
cache: false,
success: function(data){
$('#BigPlace').html(data);
}
});
e.preventDefault();
});
});
I wrapped it in a shorthand document ready function that also passes the jQuery variable as $ afresh in case jQuery is in noConflict mode.
Oh, and by way of explanation about having to use the relative URL in the links, that's because if you navigate to the page as www. whatever and the links are hard coded without the www. part or visa versa, the links will not fire because they're seen as off site. AJAX has a same domain policy. You could use the network path though. That's the same as the absolute path, just without the http://www.somedomain.com parts. In other words, using a / to signify the root of the domain:
Code:
<a href="/Scripts/africa_search.php" target="BigPlace">
And, you don't need the target attribute either, but it could be used to determine which div to target:
Code:
jQuery(function($){
$(document).on('click', '.cj-item a', function(e){
var href = this.href, $target = $('#' + this.target);
$.ajax({
url: href,
cache: false,
success: function(data){
$target.html(data);
}
});
e.preventDefault();
});
});
Bookmarks