/    Sign up×
Community /Pin to ProfileBookmark

Script Help: window with no toolbars

Hi,

I found the following script on your site and do not fully understand how to implement it on my webpage. I am linking to the page I want to use the script on from a dhtml menu which just uses a url to the page. When a user clicks on the link in the menu I would like the page to open without the toolbars.

I found the following script on your site and do not fully understand how to implement it on my webpage:

What they are usually doing is opening a new window from a hyperlink. You can use a JavaScript function to open a window with no toolbars, menubars, or other related devices, like this:

<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>
</head>
<body>

Question: In the (above) script where (sURL) is this where I insert the link url to my webpage? Such as [url]http://mywebpage.com?[/url]

Then, when you want the link to the page, you call the function by enclosing the name of the page that you wish to open in the function’s parentheses, like this:
<A HREF=”javascript:openit (‘clicktext.html’)”>
open window with no toolbars</A>

Note:I can understand the (above) link can be used on any page but it does not help me when linking to my page from the DHTML menu.

If you wish to open this new window when the page first appears, call the function from the onLoad event in the BODY tag of the hyperlinked page, such as in this example:
<BODY onLoad=”openit (‘clicktest’)”>

Note: This is the part (above) that may provide the answer to my problems. I noticed that (‘clicktest’) does not include the (.html). Is that correct?

At the bottom of the openit( ) function, you can include the following code:
window.history.go(-1);

Question: This part (above) I do not understand. Where to place this in the code at the bottom of the openit( ) function? If you could show an example of this in the code above that would be great!

This will cause the new window to open, and the old window to go back by one page in its history, so that it appears that the hyperlink just opened the new window, even if you are linked from someone else’s site.
The JavaScript code would be the only code on the page that is initially called, with the newly opened browser window containing the actual linked page.

Thank you much!

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @nascarup spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...