Forum Moderators: open

Message Too Old, No Replies

How do I open a new page resized using Javascript?

         

JioFreed

5:35 pm on May 16, 2004 (gmt 0)

10+ Year Member



I have tried searching the web ( briefly :P ) for the right javascript. This website in one of the top 10 slots. It brought me to a thread on javascript and how to open a new page using it. Unfortunately it didn't work for me. Here is the exact code I'm trying to use to get a new page opened in a new window resized / no scrolls / etc...

<a href="file:///C:\My Documents\manga\jiofreed.htm" onclick="window.open('file:///C:\My Documents\manga\jiofreed.htm','width=771',
'with=317','resizeable=no','toolbar=no','location=no',
'menubar=no','scrollbars=no')">Jio Freed</a>

I really don't know what I'm doing wrong :( So if anyone can help it would be appreciated :)

[edited by: tedster at 5:36 pm (utc) on May 17, 2004]
[edit reason] fix side-scroll [/edit]

Bernard Marx

6:57 pm on May 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



--one line if possible--
'file:///C:\My Documents\manga\jiofreed.htm','windowName','width=771,height=317,resizeable=no,toolbar=no,location=no,
menubar=no,scrollbars=no')"

Don't quote the property/value pairs individually
(changed 'with' to 'height')
Needs 3 arguments, included 2nd arg, the name of the window.

JioFreed

12:09 am on May 17, 2004 (gmt 0)

10+ Year Member



Can you write out the exact full code for it to work?

Bernard Marx

8:17 am on May 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



--put all on one line (the onclick, at least)--
<a href="file:///C:\My Documents\manga\jiofreed.htm"
onclick="window.open('file:///C:\My Documents\manga\jiofreed.htm','windowName','width=771,height=317,resizeable=no,toolbar=no,location=no,menubar=no,scrollbars=no');return false;">Jio Freed</a>

The 'return false' stops the URL in the href being followed.
Keep the href URL. The link will work in some form
even if JS is disabled.

[edited by: tedster at 5:37 pm (utc) on May 17, 2004]
[edit reason] fix side-scroll [/edit]