aacosta
asked on
About JavaScript
I have this function:
<script language="JavaScript">
<!--
function OpenWindow() {
pagina="home.html";
var wnd="four11Kiosk";
var pagina="home.html"
var width='430';
var height='300';
var loc="/scripts/ale/pendient es.idc";
var myWindow = window.open(loc,
wnd,"resizable=yes,scrollb ars=yes,wi dth="+widt h+",height ="+height) ;
return pagina;
}
-->
</script>
and I am calling it troughtout this command:
<a href="javascript:OpenWindo w()"; return true;>Consultar TT</a>
So, I want to open a new browser in my client with a new page and open a new page in my original browser, how can I do it.
Thanks.
<script language="JavaScript">
<!--
function OpenWindow() {
pagina="home.html";
var wnd="four11Kiosk";
var pagina="home.html"
var width='430';
var height='300';
var loc="/scripts/ale/pendient
var myWindow = window.open(loc,
wnd,"resizable=yes,scrollb
return pagina;
}
-->
</script>
and I am calling it troughtout this command:
<a href="javascript:OpenWindo
So, I want to open a new browser in my client with a new page and open a new page in my original browser, how can I do it.
Thanks.
ASKER
Yor are right, but at the time my browser is opening the page home.html it does does not finish loading the page, why?, the browser only open me a new browser with pendientes.idc
Thanks.
Thanks.
ASKER
Yor are right, but at the time my browser is opening the page home.html it does does not finish loading the page, why?, the browser only open me a new browser with pendientes.idc
Thanks.
Thanks.
Could you be more specific about waht the "original problem" was? Which part didn't work?
The "return true" seems strange... is it in any handler like onclick? Or just in the HTML code... the way you posted it, it won't work correctly...
You said: "and open a new page in my original browser"...
Where do you do that??`You need to call document.location.href='ne wpageforma inwindow.h tml' as well...
IF you want "href='JavaScript:OpenWind ow()'" to point to home.html, because that's the value your function returns, I have to disappoint you. You cannot use JavaScript-values that easily
Try this: <a href=&{OpenWindow()};>Cons ultar TT</a>
or this: <a href='home.html' onclick='OpenWindow()'>
Actually, the second way is better because it will work in nearly all brwosers - the first one is will only work in Netscape.
Let me know if that helped...
The "return true" seems strange... is it in any handler like onclick? Or just in the HTML code... the way you posted it, it won't work correctly...
You said: "and open a new page in my original browser"...
Where do you do that??`You need to call document.location.href='ne
IF you want "href='JavaScript:OpenWind
Try this: <a href=&{OpenWindow()};>Cons
or this: <a href='home.html' onclick='OpenWindow()'>
Actually, the second way is better because it will work in nearly all brwosers - the first one is will only work in Netscape.
Let me know if that helped...
ASKER
Hello, thanks for your tips. Your are right, I used the second way and it worked!, Thanks, but I have another question, if you like answer me it and I will graded you :-).
After I open my windows with java script, can I close it from my original window? I mean:
I have windows1, it open a new windows2 (I have boths opened), can I close windows2 from windows1 with and event botton?.
Thanks.
After I open my windows with java script, can I close it from my original window? I mean:
I have windows1, it open a new windows2 (I have boths opened), can I close windows2 from windows1 with and event botton?.
Thanks.
just a little correction to fshakir's rejected answer:
<body onload="window.open('/scri pts/ale/pe ndientes.i dc', 'four11Kiosk', 'resizable=yes,scrollbars= yes,width= 430,height =300')"
</body>
<body onload="window.open('/scri
</body>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!, it`s working
in the home.html page, paste this in:
<body onload="window.open(/scrip
</body>