I’ve finally fixed the issues with my site’s music.
Aside from the choice of music, which in all likelihood can’t be helped (heh), the biggest problem was the constant reloading of music with each page (e.g. my old joomla sites).
The first nonperfect workaround was to load the basic html music callup only on the front page, which meant that other lower tiered pages did not have the music in the background.
With this new wordpress site i decided to add a pop up. It worked fine till the user returned to the home page and the music file would simply reload.
So, after a bit of googling, i’ve finally gotten a mishmash of a solution, that surprisingly, works. Well, maybe not surprising to those code geeks out there.
Anyways, here it is. Feel free to copy and paste – just don’t forget to replace the url of my site’s music page with yours. Javascript doesn’t allow access to files outside your own domain due to security issues, so you’ll still have to change it anyway.
<SCRIPT TYPE=”text/javascript”>
<!–
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == ‘string’)
href=mylink;
else
href=mylink.href;
window.open(href, windowname, ‘width=400,height=200,scrollbars=yes’);
// if we just opened the window
if (
mywin.closed ||
(! mywin.document.URL) ||
(mywin.document.URL.indexOf(“about”) == 0)
)
mywin.location=href;
else if (refocus)
mywin.focus();
return false;
}
//–>
</SCRIPT><BODY onLoad=”return popupnr(‘http://www.faii.net/sitemusic.html’, ‘music’)”>
(the post title again is geared towards SEO)
Tags: Admin, javascript, web integration, web stuff


