472,096 Members | 1,230 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

Redirect into window.open

I'm shelling out to an .asp (or htm) page from an application. I want
to show this in a window without the address bar, etc...

Is there a way I can redirect this page using javascript to a page
where I can set the window height, statusbar=no, etc?

Thanks,
-Luke
Jul 20 '05 #1
6 11991
In article <ll********************************@4ax.com>,
lu***@teleport.com shared the illuminating thought...
I'm shelling out to an .asp (or htm) page from an application. I want
to show this in a window without the address bar, etc...

Is there a way I can redirect this page using javascript to a page
where I can set the window height, statusbar=no, etc?

Thanks,
-Luke


It can be done from the client side and by opening a new window. You
can't do it from the server and you can't change the attributes of a
window that is already open.

What is doing the "shelling out"? If it's a web service, you don't have
control of the client. If you own the html page that is running on the
browser, you can open a new window and display whatever results you want
in it.
You didn't say if this was a form submission, an included file, or
whatever, so I can't give much more of an answer without knowing the
context.

----------------------------------------
~kaeli~
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
Kill one man and you are a murderer.
Kill millions and you are a conqueror.
Kill everyone and you are God.
----------------------------------------
Jul 20 '05 #2
I am shelling out of an application (a simple VB application). The OS
will pick the browser (most likely IE).

All I can specify is a web page.

I have control of the server and the application.

If I shell out to a web page then it will be displayed just like any
web page. What I want to do is to display this web page with several
of the window.open properties either enabled or disabled. Therefore I
believe I need to execute a javascript command that will do this.

My tactic was to create a stub page that had some sort of javascript
which will display the page.

The issue is that I want to do a redirect so that the stub page goes
away (I don't want two browser windows open).

Can I specify window parameters with location.href? Can I specify
window parameters in a META REFRESH tag?

That's what I need help with.

-Luke

On Tue, 8 Jul 2003 12:26:49 -0500, kaeli
<in********************@NOSPAMatt.net> wrote:
In article <ll********************************@4ax.com>,
lu***@teleport.com shared the illuminating thought...
I'm shelling out to an .asp (or htm) page from an application. I want
to show this in a window without the address bar, etc...

Is there a way I can redirect this page using javascript to a page
where I can set the window height, statusbar=no, etc?

Thanks,
-Luke


It can be done from the client side and by opening a new window. You
can't do it from the server and you can't change the attributes of a
window that is already open.

What is doing the "shelling out"? If it's a web service, you don't have
control of the client. If you own the html page that is running on the
browser, you can open a new window and display whatever results you want
in it.
You didn't say if this was a form submission, an included file, or
whatever, so I can't give much more of an answer without knowing the
context.

----------------------------------------
~kaeli~
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
Kill one man and you are a murderer.
Kill millions and you are a conqueror.
Kill everyone and you are God.
----------------------------------------


Jul 20 '05 #3
In article <70********************************@4ax.com>,
lu***@teleport.com shared the illuminating thought...
I am shelling out of an application (a simple VB application). The OS
will pick the browser (most likely IE).

If it were a Windows application that was always IE, you'd have more
choices, but if it's internet where you don't know for sure, then you
have to allow for all browsers.
All I can specify is a web page.

I have control of the server and the application.

If I shell out to a web page then it will be displayed just like any
web page. What I want to do is to display this web page with several
of the window.open properties either enabled or disabled. Therefore I
believe I need to execute a javascript command that will do this.

My tactic was to create a stub page that had some sort of javascript
which will display the page.

The issue is that I want to do a redirect so that the stub page goes
away (I don't want two browser windows open).

Can I specify window parameters with location.href? Can I specify
window parameters in a META REFRESH tag?
No and no.
And a lot of people disable the awful meta refresh. I know I do.
People can also specify that new windows shouldn't be opened and that
you shouldn't take away functionality if they use Mozilla, which I also
do.

You have more options if this is an application that runs on a PC or if
this is intranet (instead of internet).

That's what I need help with.


You can't do this in a normal security environment nor in a cross-
browser fashion. Besides, anything you take away can be easily
reobtained by the user with the right-click menu.

Ideally, you shouldn't do it anyway. It defeats the purpose of
separating design from content, which is the way applications should be
done. Application data / content, HTML, and style - all should be a
separate tier. This was one of the reasons for XML and CSS.
But, many people are responsible for all three tiers, especially on
smaller sites, so the separation has a blurry line.

Theoretically, if your users had IE with a minimal security environment,
you could open a new window and close the current one, but users get a
warning when you do that normally.
If you were using Windows/IE exclusively, you could use WSH/HTA to
control things.

VB has a browser control. If this is an application run by the user on
their computer (.exe), using that would be a better alternative.

----------------------------------------
~kaeli~
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
Kill one man and you are a murderer.
Kill millions and you are a conqueror.
Kill everyone and you are God.
----------------------------------------
Jul 20 '05 #4
Thanks to all.

First off. Let me just set part of this thread straight. This is an
Intranet and an exclusive IE shop. All we are doing with this page is
showing a preview of a page that will be uploaded to one or more web
sites.

Thus, the "previewed" page will be a standard ASP page. The redirect
page will be in-house and in-house only. Right now I have a call in
VB.NET using this function

System.Diagnostics.Process.Start(URL)

which will open the URL with the default browser which in our case
will always be IE.

Our apps create HTML based on several disparte sources of data. All I
wanted to accomplish was a preview of a page without the "external" UI
stuff.

Thanks,
-Luke

On Tue, 8 Jul 2003 18:49:04 +0100, "Richard Cornford"
<Ri*****@litotes.demon.co.uk> wrote:
"lukeo" <lu***@teleport.com> wrote in message
news:ll********************************@4ax.com.. .
I'm shelling out to an .asp (or htm) page from an application.
I want to show this in a window without the address bar, etc...

Is there a way I can redirect this page using javascript to
a page where I can set the window height, statusbar=no, etc?


Theoretically yes, in practice maybe no.

Passing the URL of the required page as the first argument to a call to
the window.open method and specifying the desired chrome in the third
("features" string) argument is the standard approach to achieving what
you want.

However, in an Internet context this has become a less reliable course
of action than it was a couple of years ago. First chrome control has
been severally restricted by some browser manufactures, Gecko (Mozilla,
Netscape 7, etc.,) browsers offer the user the option of vetoing most,
if not all, chrome specifications in the "features" string. In addition
content inserting/re-writing proxies facilitate this on browsers that do
not support it themselves. Proximitron, for example, in its default
configuration will always replace the "features" string with a (user
alterable) alternative that leaves the normal chrome in place. There are
also one or two browsers that will ignore the "features" string as a
matter of course (ICEBrowser for example).

That would leave the chrome of any new window that was opened
indeterminate. And even if a window was opened without toolbars etc
simply pressing Ctrl+n (on IE) will open a new window with normal chrome
and showing the current page.

Then there is pop-up blocking with external programmes and browser
settings. Many combinations of realistic possibilities will result in a
call to the window.open function not opening a new window at all, or
sometimes navigation the current window to the URL provided for the
window open call (and the chrome of the current window will be
unaltered).

Tabbed browsers may also not co-operate with your intentions, opening th
e new widow as a new tab but not depriving the browser of the existing
user specified chrome.

And finally, small PDA browsers often cannot open new windows, do not
have a window.open function.

That leaves the desire to specify the chrome of a new window doomed to
failure under some circumstances (the user will have the chrome that
they want, if they care to arrange that) and quickly reversible even if
it is successful. While attempting to achieve the desired chrome by
opening a new window may just server to bar access to the page to a
number of potential visitors (including anyone who has JavaScript
disabled/unavailable).

It might just be best to review the reasoning behind the desire to
specify the chrome for a site.

Richard.


Jul 20 '05 #5
In article <8e********************************@4ax.com>,
lu***@teleport.com shared the illuminating thought...
Thanks,

Please see the other post. I think this thread has jumped the tracks.
All what we are trying to do is preview a page that will eventualy be
placed on a web site. The actual page is an ASP page which uses CSS
but not yet XSL, etc.

All I was concerned about was a proxy redirect page which will pop
this page in a window without the address bar and status bar, etc.

-Luke


The best way I can think of is instead of calling the external browser,
to call the custom browser component available in ASP.NET. I am not
overly familiar with .NET, but VB6 has an easy to use browser component
for things like this.
I can't think of any other way to do this (that would close the current
window with no alerts to the user). If the user has their security low
enough for the intranet, you can do self.close() to close the window. If
their security is on normal, though, they get an alert that says
something like "the application is trying to close the window.
Continue?"

Try having this in the page and see if users get alerts...

window.open("myPage.asp","","toolbars=no");
self.close();

----------------------------------------
~kaeli~
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
----------------------------------------
Jul 20 '05 #6
Sounds like you should be using HTAs.

<HTML>
<HEAD>
<TITLE>My Monster Application</TITLE>
<HTA:APPLICATION ID="oMyApp"
APPLICATIONNAME="monster"
BORDER="thin"
CAPTION="no"
ICON="/graphics/creature.ico"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="no"
WINDOWSTATE="normal">
</HEAD>
<BODY>
</BODY>
</HTML>

lukeo wrote:
Thanks to all.

First off. Let me just set part of this thread straight. This is an
Intranet and an exclusive IE shop. All we are doing with this page is
showing a preview of a page that will be uploaded to one or more web
sites.

Thus, the "previewed" page will be a standard ASP page. The redirect
page will be in-house and in-house only. Right now I have a call in
VB.NET using this function

System.Diagnostics.Process.Start(URL)

which will open the URL with the default browser which in our case
will always be IE.

Our apps create HTML based on several disparte sources of data. All I
wanted to accomplish was a preview of a page without the "external" UI
stuff.

Thanks,
-Luke

On Tue, 8 Jul 2003 18:49:04 +0100, "Richard Cornford"
<Ri*****@litotes.demon.co.uk> wrote:
"lukeo" <lu***@teleport.com> wrote in message
news:ll********************************@4ax.com.. .
I'm shelling out to an .asp (or htm) page from an application.
I want to show this in a window without the address bar, etc...

Is there a way I can redirect this page using javascript to
a page where I can set the window height, statusbar=no, etc?


Theoretically yes, in practice maybe no.

Passing the URL of the required page as the first argument to a call to
the window.open method and specifying the desired chrome in the third
("features" string) argument is the standard approach to achieving what
you want.

However, in an Internet context this has become a less reliable course
of action than it was a couple of years ago. First chrome control has
been severally restricted by some browser manufactures, Gecko (Mozilla,
Netscape 7, etc.,) browsers offer the user the option of vetoing most,
if not all, chrome specifications in the "features" string. In addition
content inserting/re-writing proxies facilitate this on browsers that do
not support it themselves. Proximitron, for example, in its default
configuration will always replace the "features" string with a (user
alterable) alternative that leaves the normal chrome in place. There are
also one or two browsers that will ignore the "features" string as a
matter of course (ICEBrowser for example).

That would leave the chrome of any new window that was opened
indeterminate. And even if a window was opened without toolbars etc
simply pressing Ctrl+n (on IE) will open a new window with normal chrome
and showing the current page.

Then there is pop-up blocking with external programmes and browser
settings. Many combinations of realistic possibilities will result in a
call to the window.open function not opening a new window at all, or
sometimes navigation the current window to the URL provided for the
window open call (and the chrome of the current window will be
unaltered).

Tabbed browsers may also not co-operate with your intentions, opening th
e new widow as a new tab but not depriving the browser of the existing
user specified chrome.

And finally, small PDA browsers often cannot open new windows, do not
have a window.open function.

That leaves the desire to specify the chrome of a new window doomed to
failure under some circumstances (the user will have the chrome that
they want, if they care to arrange that) and quickly reversible even if
it is successful. While attempting to achieve the desired chrome by
opening a new window may just server to bar access to the page to a
number of potential visitors (including anyone who has JavaScript
disabled/unavailable).

It might just be best to review the reasoning behind the desire to
specify the chrome for a site.

Richard.


--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Hugh Welford | last post: by
4 posts views Thread by margaret | last post: by
3 posts views Thread by Sehboo | last post: by
8 posts views Thread by msnews.microsoft.com | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.