Solution One: Use AJAX
The Javascript library jQuery facilitates asynchronous requests to your content.
For instance, after including the necessary .js files, you can use:
$("#SampleLink").click(function() {
$.ajax({
url : 'TargetPage.php',
success: function(data){
$('#MainBodyContentDIV').html(data);
}
});
});
to load the target page's HTML into the DIV with ID MainBodyContentDIV
when a link with ID SampleLink
is clicked.
This solution requires you to use Javascript and jQuery, and so comes with all the cons (and pros!) of using them.
I suggest you to do some reading (if you haven't already) on these before making any serious changes to your site.
For example, you will have to enclose the code above within a function and run it via onClick
events, either through jQuery entirely, or through the HTML attribute (which is also named onClick
).
This solution will cut down the page refreshes that interrupt your music.
Solution Two: Use an iFrame Anyway
If appropriately styled, this won't be a visual issue.
Here's a link to a question about the use of iFrames.
I might be wrong, but I believe that the simplest way for you to work around this problem is to use an iFrame.
Categories