Forum Moderators: mack

Message Too Old, No Replies

Make window with no tool bar

no toolbar windows

         

Penguinsnob

9:08 am on May 8, 2003 (gmt 0)

10+ Year Member



Hello,
I would like to make a window with no tool bar to popup when a user click on a link. I want to use the popup window to play back video in embedded wmp. embedded part works, but can't figure out how to use a java function.

<SCRIPT LANGUAGE="Java Script">
<!--//
function openit(sURL){
newwindow=open(sURL,"newwin","scrollbars=no, toolbar=no,
directories=no, menu bar=no, resizable=yes,
status=yes, width=600, height=500");
}
//-->
</SCRIPT>

and I found a code to pop this window

<a href="popup/t.htm" onclick=openit('http://foo.com/popup/videowindow1.htm');return false;">
or
<a href="openit('http://foo.com/popup/videowindow1.htm')">

both of them does not work. i simply get a 404 error, or open regular browser window.

jpjones

9:32 am on May 8, 2003 (gmt 0)

10+ Year Member



<a href="popup/t.htm" onclick=openit('http://foo.com/popup/videowindow1.htm');return false;">
or
<a href="openit('http://foo.com/popup/videowindow1.htm')">

I believe you have problems with your code.

In the first example, when the link is clicked, the command tells the browser to:
- Change the current location to "popup/t.htm"
- Open up a new window and display the URL "http://foo.com/popup/videowindow1.htm"

The second is a malformed command - it will simply tell the browser to change the current location to openit('http://foo.com/popup/videowindow1.htm'), which is not what you want.

Instead, try the following:

<a href="#" onClick="openit('http://foo.com/popup/videowindow1.htm')">

HTH,
JP

Penguinsnob

10:09 am on May 8, 2003 (gmt 0)

10+ Year Member



I tried:
<a href="#" onClick="openit('popup/t.htm')">

and when I hover my mouse over the link, i see

[foo.com...]

When I click on it, page reloads and i don't see pop up.
I turned off my popup killer so that's not it. Must be something wrong with my code. I put the script between <head> and </head>

jpjones

10:53 am on May 8, 2003 (gmt 0)

10+ Year Member



A couple of other points:

<SCRIPT LANGUAGE="Java Script">

Remove the space between "Java" and "Script".
E.g.

<SCRIPT LANGUAGE="JavaScript">

function openit(sURL){
newwindow=open(sURL,"newwin","scrollbars=no, toolbar=no,
directories=no, menu bar=no, resizable=yes,
status=yes, width=600, height=500");
}

The newwindow command needs to all be one on one line, rather than split across 3.
E.g.


function openit(sURL){
newwindow=open(sURL,"newwin","scrollbars=no, toolbar=no, directories=no, menu bar=no, resizable=yes, status=yes, width=600, height=500");
}

To stop the page jumping to the top everytime you click on the link, you could replace the <a href with the following:

<a href="javascript:openit('http://foo.com/popup/videowindow1.htm')">

HTH,
JP

ShawnR

12:40 pm on May 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"...both of them does not work. i simply get a 404 error, or open regular browser window..."

Based on that, I think the problem is something to do with your file name. Make sure the html file you are trying to open is called 'videowindow1.htm'.


<a href="popup/t.htm" onclick=openit('http://foo.com/popup/videowindow1.htm');return false;">
or
<a href="openit('http://foo.com/popup/videowindow1.htm')">


I believe you have problems with your code.

In the first example, when the link is clicked, the command tells the browser to:
- Change the current location to "popup/t.htm"
- Open up a new window and display the URL "http://foo.com/popup/videowindow1.htm"

The second is a malformed command - it will simply tell the browser to change the current location to openit('http://foo.com/popup/videowindow1.htm'), which is not what you want..."

The first example say 'when a mouse click occurs then run the openit() function'. The 'return false;' bit tells the browser: 'After the function completes you can stop, and ignore the "href=..."'. If javascript is not enabled on the browser, then the href=... stuff is used instead.

The second example is a shorthand for <a href="javascript:openit('...');">. I don't think it is malformed, although (with or without the "javascript:") it is not as good practice, and the first one is better, because the second one won't work if the visitor doesn't have javascript enabled.

Shawn