This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Disabling browser /sub window buttons.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disabling browser /sub window buttons...." Watch "Disabling browser /sub window buttons...." New topic
Author

Disabling browser /sub window buttons....

Gabriel Fox
Ranch Hand

Joined: Oct 17, 2001
Posts: 170
1.How can i disable the close and the resize icons on the top right corner
of a sub-window opened from a JavaScript function like this :
function XXXX()
{
var winRef=window.open("ABC.jsp","windowName","window features..");
}
2. How do i prevent the user from using the main browser back and forward button
(To view the previous and next page) without physically disabling them.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
goto http://www10.brinkster.com/a1ien51/
look at the back button page and the resize page and look at the link below for my pop up window generator
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

there is no way to disable the X it the title bar thank god! why do people want to do this anyway. would you like it if a site you went to popped up windows you couldnt close? how about it they popped up thousands of windows like that and caused you puter to crash?


SCJP
Visit my download page
Gabriel Fox
Ranch Hand

Joined: Oct 17, 2001
Posts: 170
Thanks Ian for the reference.I will get back to U soonest.
Hi Randall , i have a button on the sub-window
which serves as close icon(x) and i have attached some logic in the function called by this button , it also refreshes the parent window with some DB extract when clicked by user.
I thought it was possible to disable some/all
browser buttons using JavaScript. I am interested in this code if any.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

you cant disable the X but you can do this: <body onunload="yourfunction()">
[ April 27, 2002: Message edited by: Randall Twede ]
Gabriel Fox
Ranch Hand

Joined: Oct 17, 2001
Posts: 170
Is it functionally possible to attach event handlers functions to OnUnload and Onload on the the same page/JSP. Can both events be fired on same page even if at different instances.
Gabriel Fox
Ranch Hand

Joined: Oct 17, 2001
Posts: 170
cheers Al those logic for stopping resizing
and browser back worked .
cheers Randall.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2


Is it functionally possible to attach event handlers functions to OnUnload and Onload on the the same page/JSP. Can both events be fired on same page even if at different instances.

yes that is not a problem and yes both events always happen
swati bannore
Ranch Hand

Joined: Oct 18, 2000
Posts: 201
HI, Ian
The pop window generator is great. But I need additional functionality in my application. I need to disable right mouse click in the poped-up window.
How can I do it? Any Help??
Thx


Swati Kale
SCJP
SCWCD
Onkar Shendge
Greenhorn

Joined: May 29, 2002
Posts: 11
Go through following link. It has similar implementation. Only additional thing you need to do here is capture events of poped up window.
http://developer.netscape.com/docs/manuals/js/client/jsref/handlers.htm#1120635
Thanks,
Onkar Shendge
[ May 29, 2002: Message edited by: onkarshendge ]
[ August 21, 2002: Message edited by: onkarshendge ]

- Onkar
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 565
You could attach a robot arm to the user's computer and control it via an applet and the serial port. If the user right-clicks on your page, give him a slap with the robot arm. He will soon stop right-clicking.


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 815
Hi All,
I hadn't noticed this stuff mentioned anywhere so I figured I would just throw this out. I noticed someone mentioned why disable the X in a window?
Since I had been dealing with NS for a project we could set the style of the browser to Kiosk (or super kiosk) mode. This would be used on a local intranet, not the internet. Look at the path (I believe) of the NS Browser and set the -browser to -sk (superkiosk) or -k (kiosk). Doing this removes the toolbar, menubar, and even the top right 3 buttons. Hope this might help someone out there.
Rob
swati bannore
Ranch Hand

Joined: Oct 18, 2000
Posts: 201
Adam..LoL
Wish cld do that..and no one wld turn to my page.
Anyways, I found the solution for it,Thx all.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disabling browser /sub window buttons....
 
Similar Threads
How to by pass pop up blockers while using window,open()
authentication and sessions
Problem with submit to parent
Swing Application Problems
Go back functionality in jsp