Redirect into window.open

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lukeo

    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
  • kaeli

    #2
    Re: Redirect into window.open

    In article <llslgvg68p38mh fmk173a6m819bc1 i4fa2@4ax.com>,
    lukeo@teleport. com shared the illuminating thought...[color=blue]
    > 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
    >[/color]

    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~


    Kill one man and you are a murderer.
    Kill millions and you are a conqueror.
    Kill everyone and you are God.
    ----------------------------------------

    Comment

    • lukeo

      #3
      Re: Redirect into window.open

      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
      <infinite.possi bilities@NOSPAM att.net> wrote:
      [color=blue]
      >In article <llslgvg68p38mh fmk173a6m819bc1 i4fa2@4ax.com>,
      >lukeo@teleport .com shared the illuminating thought...[color=green]
      >> 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
      >>[/color]
      >
      >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.
      >----------------------------------------[/color]

      Comment

      • kaeli

        #4
        Re: Redirect into window.open

        In article <701mgvo9muf3lb vkeslhor70s4moj rbjbl@4ax.com>,
        lukeo@teleport. com shared the illuminating thought...[color=blue]
        > I am shelling out of an application (a simple VB application). The OS
        > will pick the browser (most likely IE).
        >[/color]

        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.
        [color=blue]
        > 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?[/color]

        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).
        [color=blue]
        >
        > That's what I need help with.
        >[/color]

        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~


        Kill one man and you are a murderer.
        Kill millions and you are a conqueror.
        Kill everyone and you are God.
        ----------------------------------------

        Comment

        • lukeo

          #5
          Re: Redirect into window.open

          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.Diagnost ics.Process.Sta rt(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"
          <Richard@litote s.demon.co.uk> wrote:
          [color=blue]
          >"lukeo" <lukeo@teleport .com> wrote in message
          >news:llslgvg68 p38mhfmk173a6m8 19bc1i4fa2@4ax. com...[color=green]
          >>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?[/color]
          >
          >Theoreticall y 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
          >configuratio n 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
          >indeterminat e. 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.
          >[/color]

          Comment

          • kaeli

            #6
            Re: Redirect into window.open

            In article <8enngvg4a3lbvj kb8ep8g7enpb21o 2s618@4ax.com>,
            lukeo@teleport. com shared the illuminating thought...[color=blue]
            > 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[/color]

            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("my Page.asp","","t oolbars=no");
            self.close();

            ----------------------------------------
            ~kaeli~


            Jesus saves, Allah protects, and Cthulhu
            thinks you'd make a nice sandwich.
            ----------------------------------------

            Comment

            • Grant Wagner

              #7
              Re: Redirect into window.open

              Sounds like you should be using HTAs.

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

              lukeo wrote:
              [color=blue]
              > 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.Diagnost ics.Process.Sta rt(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"
              > <Richard@litote s.demon.co.uk> wrote:
              >[color=green]
              > >"lukeo" <lukeo@teleport .com> wrote in message
              > >news:llslgvg68 p38mhfmk173a6m8 19bc1i4fa2@4ax. com...[color=darkred]
              > >>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?[/color]
              > >
              > >Theoreticall y 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
              > >configuratio n 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
              > >indeterminat e. 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.
              > >[/color][/color]

              --
              | Grant Wagner <gwagner@agrico reunited.com>

              * Client-side Javascript and Netscape 4 DOM Reference available at:
              *


              * Internet Explorer DOM Reference available at:
              *
              Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


              * 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


              Comment

              Working...