Hi,
I'm not sure if my question is really related to JavaScript, so please excuse me if that's not the case (and maybe you guys would have an idea what's the cause is and where could I ask)...
I recently put the following script online:
<script type="text/javascript"><!--
function playmedia(media file) {
newwindow=windo w.open();
if (window.focus) {newwindow.focu s()}
newwindow.docum ent.write('<htm l>');
newwindow.docum ent.write(' <head>');
newwindow.docum ent.write(' <title>Media player</title>');
newwindow.docum ent.write(' </head>');
newwindow.docum ent.write(' <body bgcolor="#A0A0F F" text="#000000"> ');
newwindow.docum ent.write(' <center>');
newwindow.docum ent.write(' <h2>Playing the media file... ♫</h2><br>');
newwindow.docum ent.write(' <!-- show play button, autostart and loop once -->');
newwindow.docum ent.write(' <embed src="' + mediafile + '" hidden=false autostart=true loop=1 autosize=1>');
newwindow.docum ent.write(' </center>');
newwindow.docum ent.write(' </body>');
newwindow.docum ent.write('</html>');
newwindow.docum ent.close();
}
//--></script>
I call this script using the following link:
<a href="errorJS.h tm" onclick="playme dia('../goodies/antarcti/antarcti.mid'); return false;">Play</a>
So far, so good: the script is working, and I do not have any problem.
Troubles comes when I want to use my website locally (I often gave an offline copy to my relatives, as they prefer to use it offline). When used from the disk, the browser (Fx) can't find the file. If I change the link from playmedia('../goodies/antarcti/antarcti.mid') to playmedia('good ies/antarcti/antarcti.mid'), then it works offline, but when put on the server I get an 404 :(
I'm using frames, too. The main frame is in / , sub-frames are in /html/ , and the media files are stored in /goodies/. It seems that in some circumstances, the "current" directory isn't the same...
Now the big question comes: Is this some Javascript-related issue? If not, what could be the problem? The browser? My web server?
The website is at http://viste.homeip.net/mateusz/nes
Best regards,
Mateusz Viste
I'm not sure if my question is really related to JavaScript, so please excuse me if that's not the case (and maybe you guys would have an idea what's the cause is and where could I ask)...
I recently put the following script online:
<script type="text/javascript"><!--
function playmedia(media file) {
newwindow=windo w.open();
if (window.focus) {newwindow.focu s()}
newwindow.docum ent.write('<htm l>');
newwindow.docum ent.write(' <head>');
newwindow.docum ent.write(' <title>Media player</title>');
newwindow.docum ent.write(' </head>');
newwindow.docum ent.write(' <body bgcolor="#A0A0F F" text="#000000"> ');
newwindow.docum ent.write(' <center>');
newwindow.docum ent.write(' <h2>Playing the media file... ♫</h2><br>');
newwindow.docum ent.write(' <!-- show play button, autostart and loop once -->');
newwindow.docum ent.write(' <embed src="' + mediafile + '" hidden=false autostart=true loop=1 autosize=1>');
newwindow.docum ent.write(' </center>');
newwindow.docum ent.write(' </body>');
newwindow.docum ent.write('</html>');
newwindow.docum ent.close();
}
//--></script>
I call this script using the following link:
<a href="errorJS.h tm" onclick="playme dia('../goodies/antarcti/antarcti.mid'); return false;">Play</a>
So far, so good: the script is working, and I do not have any problem.
Troubles comes when I want to use my website locally (I often gave an offline copy to my relatives, as they prefer to use it offline). When used from the disk, the browser (Fx) can't find the file. If I change the link from playmedia('../goodies/antarcti/antarcti.mid') to playmedia('good ies/antarcti/antarcti.mid'), then it works offline, but when put on the server I get an 404 :(
I'm using frames, too. The main frame is in / , sub-frames are in /html/ , and the media files are stored in /goodies/. It seems that in some circumstances, the "current" directory isn't the same...
Now the big question comes: Is this some Javascript-related issue? If not, what could be the problem? The browser? My web server?
The website is at http://viste.homeip.net/mateusz/nes
Best regards,
Mateusz Viste
Comment