PDA

View Full Version : All I wanted for christmas :-/



JS Novice
12-28-2004, 11:24 PM
I posted this problem originally at december, 16th, but haven't received any answers. Is it really possible that there isn't any solution, or that nobody knows the solution?? :( Well, I try one more shot, pleaze post me an answer if you can help me!

I use the following code to open a new page, or more precisely, a frameset of several pages, in full screen mode:

<script>
function fullwin(targeturl) {
window.open(targeturl,"","fullscreen,scrollbars")
}
</script>

<form>
<input type="button" onClick="fullwin('mypage.html')" value="Show My Frameset">
</form>

(My last problem was related to the same script :cool: , I needed a code to make users able to close this fullscreen window.)

Problem 1
This script opens a new window when button is pushed. When the full screen window is closed down, this page with the button is still on the screen. I want the new page to load in the same window, that is, replacing the contents in the window, like target="_top"

Q1: Can somebody out there see how I can modify or rewrite the code so that the new page loads in the same window? :confused:

Problem 2
I've modifed the latter part to the following:

<form>
<input type="button" onClick="window.close(); fullwin('mypage.html')" value="Show My Frameset">
</form>

The above code closes the initial window before the new pages were loaded into a new window in full screen mode, BUT, the browser is showing an alert; "The page you are viewing are trying to close the window. Are you sure you want to close the window (Yes/No)". (Or something like that :-/ )

Q2: Do somebody out there know how to close the first window, whitout showing any alert? The first window should close while the new one was loading, whitout asking the user anything! :o

If someone is able to help me with one of these questions, my problem is solved. I would appriciate it an be very greatful!!! If you know the answer of either Q1 or Q2, or both, please post me an answer! :-) TNX!!

mwinter
12-29-2004, 01:51 AM
<script>A script element requires a type attribute:


<script type="text/javascript">
<form>
<input type="button" onClick="fullwin('mypage.html')" value="Show My Frameset">
</form>If you're not using a form control (input, textarea, etc) to submit a value to a server, there's no point in including a form element.


Q1: Can somebody out there see how I can modify or rewrite the code so that the new page loads in the same window? :confused:So are you basically asking: "How can I make the current window fullscreen"? If not, you'll need to rephrase this question.


Q2: Do somebody out there know how to close the first window, whitout showing any alert?You could exploit a bug in IE, however one would anticipate that this security hole would be closed at some point. In short: you can't (or at least shouldn't).

Mike