M
mac
I´m trying to pop a secondary window for opening some pdf files within
it, and once open to use always the same window so the users dont get a
hundred windows open.
The problem i´m not able to solve comes when i try to re-use the same
window each time the user gets a pdf file from the main window, like i
used to do with a similar question with html files, i get those pdf
files open into the same window but i cannot make the secondary window
to regain the focus.
I want to know if being no htm file could just mean that you cant do
this i´m trying or is just i must look for a different way to regain
the focus the code im using is quite simple but here it goes, maybe
the experienced can see why i cant or how to make it works.
** in the selectedPDF is the url where the file is located
<script type="text/JavaScript">
<!--
function open_window() {
p=document.form1.desplegable.selectedIndex
selectedPDF=document.form1.desplegable.options[p].value
//alert("Elegido: '"+ seleccionado+"'")
MM_openBrWindow(seleccionado,'ventana','width=800,height=560,menubar=no,resizable=no,scrollbars=yes,status=no,titlebar=no,toolbar=no,left=0,top=0')
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
newwindow=window.open(theURL,winName,features);
newwindow.focus();
}
//-->
</script>
Thanks a bunch
it, and once open to use always the same window so the users dont get a
hundred windows open.
The problem i´m not able to solve comes when i try to re-use the same
window each time the user gets a pdf file from the main window, like i
used to do with a similar question with html files, i get those pdf
files open into the same window but i cannot make the secondary window
to regain the focus.
I want to know if being no htm file could just mean that you cant do
this i´m trying or is just i must look for a different way to regain
the focus the code im using is quite simple but here it goes, maybe
the experienced can see why i cant or how to make it works.
** in the selectedPDF is the url where the file is located
<script type="text/JavaScript">
<!--
function open_window() {
p=document.form1.desplegable.selectedIndex
selectedPDF=document.form1.desplegable.options[p].value
//alert("Elegido: '"+ seleccionado+"'")
MM_openBrWindow(seleccionado,'ventana','width=800,height=560,menubar=no,resizable=no,scrollbars=yes,status=no,titlebar=no,toolbar=no,left=0,top=0')
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
newwindow=window.open(theURL,winName,features);
newwindow.focus();
}
//-->
</script>
Thanks a bunch