Opening 2nd browser window and saving as .txt

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

    Opening 2nd browser window and saving as .txt

    I am attempting to write a javascript app that will open a second browser
    window, load a url, such as www.google.com (foreign url) and perform a
    <File-Save As> function on that window. I am able to do this with opening a
    second window that loads a local file, but I get an Access Denied error when
    I attempt this with a different website. Is there not a command in
    javascript that will allow me to open a webpage and perform this function?

    Thank you very much.


  • Sean Jorden

    #2
    Re: Opening 2nd browser window and saving as .txt

    "Clinton Goff" <cgoff@goffsolu tions.com> wrote in
    news:xjS2b.2058 27$It4.96487@rw crnsc51.ops.asp .att.net:
    [color=blue]
    > I am attempting to write a javascript app that will open a second
    > browser window, load a url, such as www.google.com (foreign url) and
    > perform a <File-Save As> function on that window. I am able to do
    > this with opening a second window that loads a local file, but I get
    > an Access Denied error when I attempt this with a different website.
    > Is there not a command in javascript that will allow me to open a
    > webpage and perform this function?
    >
    > Thank you very much.
    >
    >
    >[/color]

    my first inclination is that you will have to do this server side (ie suck
    the web page in on the server) and provide header similiar to following:

    Content-Disposition: attachment; filename="index .html"

    which will tell the browser to supply a Save As dialog for the user.


    Hope I am understanding your problem correctly.

    Comment

    • asdf asdf

      #3
      Re: Opening 2nd browser window and saving as .txt

      If you're working in IE, I suggest looking up XMLHTTP where you can
      load data from any url without worrying about rights issues. It
      sounds like in your situation you don't have leeway in your browser to
      access another domain's information. If you want a quick solution,
      look up HTML Applications or "HTA". They are completely trusted (and
      thus most people probably wouldn't want to run such a thing), but if
      you just want to open a url in an IE window and grab the text, that
      should do it.

      "Clinton Goff" <cgoff@goffsolu tions.com> wrote in message news:<xjS2b.205 827$It4.96487@r wcrnsc51.ops.as p.att.net>...[color=blue]
      > I am attempting to write a javascript app that will open a second browser
      > window, load a url, such as www.google.com (foreign url) and perform a
      > <File-Save As> function on that window. I am able to do this with opening a
      > second window that loads a local file, but I get an Access Denied error when
      > I attempt this with a different website. Is there not a command in
      > javascript that will allow me to open a webpage and perform this function?
      >
      > Thank you very much.[/color]

      Comment

      • Grant Wagner

        #4
        Re: Opening 2nd browser window and saving as .txt

        The XML HTTP Request object does actually prevent retrieving data from sites other then the one it was downloaded from
        in the default security environment.

        As indicated you could use an HTA if this functionality is for you personally. If you are writing something for other
        people to use, there isn't any way to achieve what you want without the user granting you additional permissions within
        their browser.

        asdf asdf wrote:
        [color=blue]
        > If you're working in IE, I suggest looking up XMLHTTP where you can
        > load data from any url without worrying about rights issues. It
        > sounds like in your situation you don't have leeway in your browser to
        > access another domain's information. If you want a quick solution,
        > look up HTML Applications or "HTA". They are completely trusted (and
        > thus most people probably wouldn't want to run such a thing), but if
        > you just want to open a url in an IE window and grab the text, that
        > should do it.
        >
        > "Clinton Goff" <cgoff@goffsolu tions.com> wrote in message news:<xjS2b.205 827$It4.96487@r wcrnsc51.ops.as p.att.net>...[color=green]
        > > I am attempting to write a javascript app that will open a second browser
        > > window, load a url, such as www.google.com (foreign url) and perform a
        > > <File-Save As> function on that window. I am able to do this with opening a
        > > second window that loads a local file, but I get an Access Denied error when
        > > I attempt this with a different website. Is there not a command in
        > > javascript that will allow me to open a webpage and perform this function?
        > >
        > > Thank you very much.[/color][/color]

        --
        | Grant Wagner <gwagner@agrico reunited.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 7 / Mozilla
        * http://www.mozilla.org/docs/web-deve...upgrade_2.html


        Comment

        Working...