php - my audio gets stopped when i move to another page -
i making music website. have installed sound player in div above footer. problem whenever moved next page, song stops playing. how can overcome situation. working on long time haven't succeeded yet. has suggested me working though frames other 1 said not option. shall do?
this of import me.
i helpful if tell me quick solution it.
thanks shail
solution one: utilize ajax
the javascript library jquery facilitates asynchronous requests content.
for instance, after including necessary .js files, can use:
$("#samplelink").click(function() { $.ajax({ url : 'targetpage.php', success: function(data){ $('#mainbodycontentdiv').html(data); } }); }); to load target page's html div id mainbodycontentdiv when link id samplelink clicked.
this solution requires utilize javascript , jquery, , comes cons (and pros!) of using them. suggest reading (if haven't already) on these before making serious changes site.
for example, have enclose code above within function , run via onclick events, either through jquery entirely, or through html attribute (which named onclick).
this solution cutting downwards page refreshes interrupt music.
solution two: utilize iframe anyway
if appropriately styled, won't visual issue. here's link question utilize of iframes.
i might wrong, believe simplest way work around problem utilize iframe.
php
No comments:
Post a Comment