New Window??

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

New Window??

Post by szms »

I have a link. I want to implement this link in that way so that when I will click it, it will creat a new window without any address bar or any other bar. Suppose that window just contain a picture of a Building. How to do that?
User avatar
trollll
Forum Contributor
Posts: 181
Joined: Tue Jun 10, 2003 11:56 pm
Location: Round Rock, TX
Contact:

Post by trollll »

You could just use javascript's window.open() function and specify the property list to have it not include the address bar.
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

Post by szms »

Well I am trying the following code using a function so that I can resize the window without modifying the original function. But it's giving me an error. Any suggestion?

Code: Select all

<html>
<head>
<script type="text/javascript">
function open_win(href,menubar,height,width)
&#123;
window.open(href,"my_new_window","toolbar=no, location=no, directories=no, status=no, menubar="+menubar+", scrollbars=yes, resizable=no, copyhistory=no, width="+width+", height="+height+" ")
&#125;
</script>
</head>

<body>
<a target="_blank" href="http://www.php.net" onClick="open_win(this.href,yes,400,600);return false;">Open PHP</a>
</body>

</html>
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

Code: Select all

function name_of_function() &#123;
	window.open("path_to_file.php", "", "width=523,height=425,toolbars=no,menubar=no,statusbar=no,resizable=no,scrollbars=no,history=no");
&#125;
that's the way to write it

Then it'll be

Code: Select all

<a href="javascript:name_of_function();"> some link </a>
there you go
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

Post by szms »

well I am trying to manipulate the function by passing variables. I think you didn't get what I am looking for. Thank you anyway. Further suggestion will be more appritiated.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

onClick="open_win(this.href,yes,400,600); <-- you need to quote yes, eg 'yes'
Post Reply