g00fy
03-11-2003, 12:06 PM
i have a page with alot of thumbnails in a form and i pass the image name via GET to another page which runs a movie with the same
name but an extension appended.
the problem is that the script i have written gets the name from the URL of the form
http://page.html?name.x=123&name.y=456
*the whole problem is that i want a 'toolbarless' window, it works fine if i leave the toolbars but the page looks
crap with a heap of toolbars and only a quicktime player in it.
however if i use a script to generate a popup the URL is of the form
http://javascript:function(URL) and i cant get the image(& movie) name from it :(
is there a way to do this *cleanly*, what i am doing atm is genrating a normal window via
target="_blank" and then running a function onLoad to recreate that window with no toolbars at all.
its a bit clumsy, and i'm looking for suggestions to fix it, as the whole site is to showcase my clients movies.
i can generate the URL(using js) that the form would generate but it would be even more clumsy to add thumbnails and movies to
below is the code i have written so far:
all this code is on the same page.
<script language="JavaScript">
function load(){
// these bits get around prompt on parent window close :)
parentWin = window.opener;
parentWin.opener = window.self;
//
if(this.window.name != 'win2')
setTimeout("reload()", 0);
parentWin.close();
this.window,resizeTo(400,300);
this.window.moveTo(100,100);
}
</script>
<body onLoad="javascript:load()">
<!-- script & form to pass file name to quicktime //-->
<FORM NAME="movie">
<INPUT TYPE="hidden" NAME="preview">
</FORM>
<SCRIPT LANGUAGE="javascript">
<!--
var locate = window.location.href
document.movie.preview.value = locate
var text = document.movie.preview.value
function getNameFromUrl(str){
theleft = str.indexOf("?") + 1;
theright = str.lastIndexOf("x=");
return(str.substring(theleft, theright));
}
var mpgFile = ( getNameFromUrl(text) + 'mpg' );
//-->
</SCRIPT>
<script>
document.write(' <object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" height="256" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">');
document.write(' <param name="src" value='+ mpgFile +' ');
document.write(' <param name="autoplay" value="false"> ');
document.write(' <param name="loop" value="false"> ');
document.write(' <param name="controller" value="true"> ');
document.write(' <embed src='+ mpgFile +' width="320" height="256" autoplay="false" loop="false" controller="true" pluginspage="http://www.apple.com/quicktime/"></embed> ');
document.write(' </object> ');
</script>
</body>
any help would be greatly appreciated :thumbsup:
kind regards,
g00fy
name but an extension appended.
the problem is that the script i have written gets the name from the URL of the form
http://page.html?name.x=123&name.y=456
*the whole problem is that i want a 'toolbarless' window, it works fine if i leave the toolbars but the page looks
crap with a heap of toolbars and only a quicktime player in it.
however if i use a script to generate a popup the URL is of the form
http://javascript:function(URL) and i cant get the image(& movie) name from it :(
is there a way to do this *cleanly*, what i am doing atm is genrating a normal window via
target="_blank" and then running a function onLoad to recreate that window with no toolbars at all.
its a bit clumsy, and i'm looking for suggestions to fix it, as the whole site is to showcase my clients movies.
i can generate the URL(using js) that the form would generate but it would be even more clumsy to add thumbnails and movies to
below is the code i have written so far:
all this code is on the same page.
<script language="JavaScript">
function load(){
// these bits get around prompt on parent window close :)
parentWin = window.opener;
parentWin.opener = window.self;
//
if(this.window.name != 'win2')
setTimeout("reload()", 0);
parentWin.close();
this.window,resizeTo(400,300);
this.window.moveTo(100,100);
}
</script>
<body onLoad="javascript:load()">
<!-- script & form to pass file name to quicktime //-->
<FORM NAME="movie">
<INPUT TYPE="hidden" NAME="preview">
</FORM>
<SCRIPT LANGUAGE="javascript">
<!--
var locate = window.location.href
document.movie.preview.value = locate
var text = document.movie.preview.value
function getNameFromUrl(str){
theleft = str.indexOf("?") + 1;
theright = str.lastIndexOf("x=");
return(str.substring(theleft, theright));
}
var mpgFile = ( getNameFromUrl(text) + 'mpg' );
//-->
</SCRIPT>
<script>
document.write(' <object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" height="256" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">');
document.write(' <param name="src" value='+ mpgFile +' ');
document.write(' <param name="autoplay" value="false"> ');
document.write(' <param name="loop" value="false"> ');
document.write(' <param name="controller" value="true"> ');
document.write(' <embed src='+ mpgFile +' width="320" height="256" autoplay="false" loop="false" controller="true" pluginspage="http://www.apple.com/quicktime/"></embed> ');
document.write(' </object> ');
</script>
</body>
any help would be greatly appreciated :thumbsup:
kind regards,
g00fy