Can I use a temp file with client-side JavaScript?

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

    #1

    Can I use a temp file with client-side JavaScript?

    I'm writing an html page with some JavaScript that reads a web page
    into a client-side temp file, then reformats it, then submits that
    same file as a URL to the browser for display, via "locate.replace ".

    I can do all this if the html page containing the script originates
    on the client machine, but don't know how to get access to a
    client-side temp file when the same html page containing the script is
    on a web host. How do I get access to a client-side temp file?

    or

    Is there some way I can use an array instead of a file to achieve the
    same thing? If so, how do I submit the array as a URL for the browser
    to display?

    Thanks,
    Don


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
  • McKirahan

    #2
    Re: Can I use a temp file with client-side JavaScript?

    "Don" <no@adr.com> wrote in message
    news:4v1gk015od dfnrgq30ameebm7 kiu190pga@4ax.c om...[color=blue]
    > I'm writing an html page with some JavaScript that reads a web page
    > into a client-side temp file, then reformats it, then submits that
    > same file as a URL to the browser for display, via "locate.replace ".
    >
    > I can do all this if the html page containing the script originates
    > on the client machine, but don't know how to get access to a
    > client-side temp file when the same html page containing the script is
    > on a web host. How do I get access to a client-side temp file?
    >
    > or
    >
    > Is there some way I can use an array instead of a file to achieve the
    > same thing? If so, how do I submit the array as a URL for the browser
    > to display?
    >
    > Thanks,
    > Don
    >
    >
    > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    > -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]

    Access to the client's file system (via FSO) raises an ActiveX security
    warning.

    You can use JavaScript to construct a Web page then use window.open().

    For example; watch for word-wrap.

    <html>
    <head>
    <title>myPage.h tm</title>
    <script type="text/javascript">
    function myPage() {
    var html = "<html><head><t itle>My Page</title></head>";
    html += "<body>Hell o World</body></html>";
    var wind = window.open();
    wind.document.w rite(html);
    }
    </script>
    </head>
    <body onload="myPage( )">
    </body>
    </html>

    window.open can accept parameters for greater control.


    Comment

    • Don

      #3
      Re: Can I use a temp file with client-side JavaScript?

      McKirahan,

      I just tried this and it works great. Thank you very much. I
      appreciate you taking the time with this.

      Regards, Don


      On Wed, 15 Sep 2004 10:21:23 GMT, "McKirahan" <News@McKirahan .com>
      wrote:
      [color=blue]
      >"Don" <no@adr.com> wrote in message
      >news:4v1gk015o ddfnrgq30ameebm 7kiu190pga@4ax. com...[color=green]
      >> I'm writing an html page with some JavaScript that reads a web page
      >> into a client-side temp file, then reformats it, then submits that
      >> same file as a URL to the browser for display, via "locate.replace ".
      >>
      >> I can do all this if the html page containing the script originates
      >> on the client machine, but don't know how to get access to a
      >> client-side temp file when the same html page containing the script is
      >> on a web host. How do I get access to a client-side temp file?
      >>
      >> or
      >>
      >> Is there some way I can use an array instead of a file to achieve the
      >> same thing? If so, how do I submit the array as a URL for the browser
      >> to display?
      >>
      >> Thanks,
      >> Don
      >>
      >>
      >> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
      >> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
      >> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]
      >
      >Access to the client's file system (via FSO) raises an ActiveX security
      >warning.
      >
      >You can use JavaScript to construct a Web page then use window.open().
      >
      >For example; watch for word-wrap.
      >
      ><html>
      ><head>
      ><title>myPage. htm</title>
      ><script type="text/javascript">
      >function myPage() {
      > var html = "<html><head><t itle>My Page</title></head>";
      > html += "<body>Hell o World</body></html>";
      > var wind = window.open();
      > wind.document.w rite(html);
      >}
      ></script>
      ></head>
      ><body onload="myPage( )">
      ></body>
      ></html>
      >
      >window.open can accept parameters for greater control.
      >[/color]



      -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
      http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
      -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

      Comment

      • Don

        #4
        Re: Can I use a temp file with client-side JavaScript?

        Hi McKirahan,

        Well, I'm making progress, but have a little problem with the
        following embedded script. It's supposed to read the body of a page
        into an array, then open a window on which it is then displayed. I
        have some debug "alert" statements embedded, and find the page body
        (strPageBody) is null after being read from the web site. I've tried
        just about everything I can think of. If I replace the "strPageBod y =
        xmlhttp.respons eBody" statement with one that just fills strPageBody
        with a char string it works. Any ideas?

        Thanks again, Don


        <html>
        <head>
        <title>Test</title>
        <meta http-equiv="Content-Type" content="text/html;
        charset=iso-8859-1">
        </head>
        <body>
        <script language="JavaS cript" type="text/javascript">
        <!--
        //
        var strPageURL = [];
        var strPageBody = [];
        //
        // Get page
        //
        strPageURL = "http://silvereaglenest .com/htmltestpage.ht m";
        get_page (strPageURL);
        //
        // Display page
        //
        alert ("Body just before display: "+strPageBo dy);
        var wind = window.open();
        wind.document.w rite(strPageBod y);
        //
        //
        function get_page(strPag eURL)
        {
        var userName;
        var password;
        //
        alert ("URL at start of function: "+strPageUR L);
        alert ("Body at start of function: "+strPageBo dy);
        var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
        xmlhttp.Open("G et",strPageURL, false);
        xmlhttp.send();
        strPageBody = xmlhttp.respons eBody;
        alert ("Body at end of function: "+strPageBo dy);
        }
        //-->
        </script>
        </body>
        </html>




        On Wed, 15 Sep 2004 10:21:23 GMT, "McKirahan" <News@McKirahan .com>
        wrote:
        [color=blue]
        >"Don" <no@adr.com> wrote in message
        >news:4v1gk015o ddfnrgq30ameebm 7kiu190pga@4ax. com...[color=green]
        >> I'm writing an html page with some JavaScript that reads a web page
        >> into a client-side temp file, then reformats it, then submits that
        >> same file as a URL to the browser for display, via "locate.replace ".
        >>
        >> I can do all this if the html page containing the script originates
        >> on the client machine, but don't know how to get access to a
        >> client-side temp file when the same html page containing the script is
        >> on a web host. How do I get access to a client-side temp file?
        >>
        >> or
        >>
        >> Is there some way I can use an array instead of a file to achieve the
        >> same thing? If so, how do I submit the array as a URL for the browser
        >> to display?
        >>
        >> Thanks,
        >> Don
        >>
        >>
        >> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
        >> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
        >> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]
        >
        >Access to the client's file system (via FSO) raises an ActiveX security
        >warning.
        >
        >You can use JavaScript to construct a Web page then use window.open().
        >
        >For example; watch for word-wrap.
        >
        ><html>
        ><head>
        ><title>myPage. htm</title>
        ><script type="text/javascript">
        >function myPage() {
        > var html = "<html><head><t itle>My Page</title></head>";
        > html += "<body>Hell o World</body></html>";
        > var wind = window.open();
        > wind.document.w rite(html);
        >}
        ></script>
        ></head>
        ><body onload="myPage( )">
        ></body>
        ></html>
        >
        >window.open can accept parameters for greater control.
        >[/color]



        -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
        http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
        -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

        Comment

        • McKirahan

          #5
          Re: Can I use a temp file with client-side JavaScript?

          "Don" <no@adr.com> wrote in message
          news:jciik0ptcf 9baphkheglcusbs 1hq6cbvtc@4ax.c om...[color=blue]
          > Hi McKirahan,
          >
          > Well, I'm making progress, but have a little problem with the
          > following embedded script. It's supposed to read the body of a page
          > into an array, then open a window on which it is then displayed. I
          > have some debug "alert" statements embedded, and find the page body
          > (strPageBody) is null after being read from the web site. I've tried
          > just about everything I can think of. If I replace the "strPageBod y =
          > xmlhttp.respons eBody" statement with one that just fills strPageBody
          > with a char string it works. Any ideas?
          >
          > Thanks again, Don
          >
          >
          > <html>
          > <head>
          > <title>Test</title>
          > <meta http-equiv="Content-Type" content="text/html;
          > charset=iso-8859-1">
          > </head>
          > <body>
          > <script language="JavaS cript" type="text/javascript">
          > <!--
          > //
          > var strPageURL = [];
          > var strPageBody = [];
          > //
          > // Get page
          > //
          > strPageURL = "http://silvereaglenest .com/htmltestpage.ht m";
          > get_page (strPageURL);
          > //
          > // Display page
          > //
          > alert ("Body just before display: "+strPageBo dy);
          > var wind = window.open();
          > wind.document.w rite(strPageBod y);
          > //
          > //
          > function get_page(strPag eURL)
          > {
          > var userName;
          > var password;
          > //
          > alert ("URL at start of function: "+strPageUR L);
          > alert ("Body at start of function: "+strPageBo dy);
          > var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
          > xmlhttp.Open("G et",strPageURL, false);
          > xmlhttp.send();
          > strPageBody = xmlhttp.respons eBody;
          > alert ("Body at end of function: "+strPageBo dy);
          > }
          > //-->
          > </script>
          > </body>
          > </html>
          >
          >
          >
          >
          > On Wed, 15 Sep 2004 10:21:23 GMT, "McKirahan" <News@McKirahan .com>
          > wrote:
          >[color=green]
          > >"Don" <no@adr.com> wrote in message
          > >news:4v1gk015o ddfnrgq30ameebm 7kiu190pga@4ax. com...[color=darkred]
          > >> I'm writing an html page with some JavaScript that reads a web page
          > >> into a client-side temp file, then reformats it, then submits that
          > >> same file as a URL to the browser for display, via "locate.replace ".
          > >>
          > >> I can do all this if the html page containing the script originates
          > >> on the client machine, but don't know how to get access to a
          > >> client-side temp file when the same html page containing the script is
          > >> on a web host. How do I get access to a client-side temp file?
          > >>
          > >> or
          > >>
          > >> Is there some way I can use an array instead of a file to achieve the
          > >> same thing? If so, how do I submit the array as a URL for the browser
          > >> to display?
          > >>
          > >> Thanks,
          > >> Don
          > >>
          > >>
          > >> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
          > >> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
          > >> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]
          > >
          > >Access to the client's file system (via FSO) raises an ActiveX security
          > >warning.
          > >
          > >You can use JavaScript to construct a Web page then use window.open().
          > >
          > >For example; watch for word-wrap.
          > >
          > ><html>
          > ><head>
          > ><title>myPage. htm</title>
          > ><script type="text/javascript">
          > >function myPage() {
          > > var html = "<html><head><t itle>My Page</title></head>";
          > > html += "<body>Hell o World</body></html>";
          > > var wind = window.open();
          > > wind.document.w rite(html);
          > >}
          > ></script>
          > ></head>
          > ><body onload="myPage( )">
          > ></body>
          > ></html>
          > >
          > >window.open can accept parameters for greater control.
          > >[/color]
          >
          >
          >
          > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
          > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
          > -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]

          Here's one approach; watch for word-wrap.

          <html>
          <head>
          <title>TestPage .htm</title>
          </head>
          <body>
          <script type="text/javascript">
          var sURL = "http://silvereaglenest .com/htmltestpage.ht m";
          var sHTM = get_page(sURL);
          alert(sHTM);
          var wind = window.open();
          wind.document.w rite(sHTM);

          function get_page(URL) {
          var sTMP = "C:\\temp\\Test Page.tmp";
          var oXML = new ActiveXObject(" Microsoft.XMLHT TP");
          oXML.Open("Get" ,URL,false);
          oXML.send();
          var sXML = oXML.responseBo dy;
          var oADO = new ActiveXObject(" ADODB.Stream");
          oADO.Mode = 3;
          oADO.Type = 1;
          oADO.Open;
          oADO.Write(sXML );
          oADO.SaveToFile (sTMP,2);
          var oFSO = new ActiveXObject(" Scripting.FileS ystemObject");
          var oOTF = oFSO.OpenTextFi le(sTMP,1);
          var sOTF = oOTF.ReadAll();
          oOTF.Close();
          oFSO.DeleteFile (sTMP);
          return sOTF;
          }
          </script>
          </body>
          </html>


          Comment

          • Don

            #6
            Re: Can I use a temp file with client-side JavaScript?

            On Thu, 16 Sep 2004 14:42:29 GMT, "McKirahan" <News@McKirahan .com>
            wrote:
            [color=blue]
            >"Don" <no@adr.com> wrote in message
            >news:jciik0ptc f9baphkheglcusb s1hq6cbvtc@4ax. com...[color=green]
            >> Hi McKirahan,
            >>
            >> Well, I'm making progress, but have a little problem with the
            >> following embedded script. It's supposed to read the body of a page
            >> into an array, then open a window on which it is then displayed. I
            >> have some debug "alert" statements embedded, and find the page body
            >> (strPageBody) is null after being read from the web site. I've tried
            >> just about everything I can think of. If I replace the "strPageBod y =
            >> xmlhttp.respons eBody" statement with one that just fills strPageBody
            >> with a char string it works. Any ideas?
            >>
            >> Thanks again, Don
            >>
            >>
            >> <html>
            >> <head>
            >> <title>Test</title>
            >> <meta http-equiv="Content-Type" content="text/html;
            >> charset=iso-8859-1">
            >> </head>
            >> <body>
            >> <script language="JavaS cript" type="text/javascript">
            >> <!--
            >> //
            >> var strPageURL = [];
            >> var strPageBody = [];
            >> //
            >> // Get page
            >> //
            >> strPageURL = "http://silvereaglenest .com/htmltestpage.ht m";
            >> get_page (strPageURL);
            >> //
            >> // Display page
            >> //
            >> alert ("Body just before display: "+strPageBo dy);
            >> var wind = window.open();
            >> wind.document.w rite(strPageBod y);
            >> //
            >> //
            >> function get_page(strPag eURL)
            >> {
            >> var userName;
            >> var password;
            >> //
            >> alert ("URL at start of function: "+strPageUR L);
            >> alert ("Body at start of function: "+strPageBo dy);
            >> var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
            >> xmlhttp.Open("G et",strPageURL, false);
            >> xmlhttp.send();
            >> strPageBody = xmlhttp.respons eBody;
            >> alert ("Body at end of function: "+strPageBo dy);
            >> }
            >> //-->
            >> </script>
            >> </body>
            >> </html>
            >>
            >>
            >>
            >>
            >> On Wed, 15 Sep 2004 10:21:23 GMT, "McKirahan" <News@McKirahan .com>
            >> wrote:
            >>[color=darkred]
            >> >"Don" <no@adr.com> wrote in message
            >> >news:4v1gk015o ddfnrgq30ameebm 7kiu190pga@4ax. com...
            >> >> I'm writing an html page with some JavaScript that reads a web page
            >> >> into a client-side temp file, then reformats it, then submits that
            >> >> same file as a URL to the browser for display, via "locate.replace ".
            >> >>
            >> >> I can do all this if the html page containing the script originates
            >> >> on the client machine, but don't know how to get access to a
            >> >> client-side temp file when the same html page containing the script is
            >> >> on a web host. How do I get access to a client-side temp file?
            >> >>
            >> >> or
            >> >>
            >> >> Is there some way I can use an array instead of a file to achieve the
            >> >> same thing? If so, how do I submit the array as a URL for the browser
            >> >> to display?
            >> >>
            >> >> Thanks,
            >> >> Don
            >> >>
            >> >>
            >> >> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
            >> >> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
            >> >> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
            >> >
            >> >Access to the client's file system (via FSO) raises an ActiveX security
            >> >warning.
            >> >
            >> >You can use JavaScript to construct a Web page then use window.open().
            >> >
            >> >For example; watch for word-wrap.
            >> >
            >> ><html>
            >> ><head>
            >> ><title>myPage. htm</title>
            >> ><script type="text/javascript">
            >> >function myPage() {
            >> > var html = "<html><head><t itle>My Page</title></head>";
            >> > html += "<body>Hell o World</body></html>";
            >> > var wind = window.open();
            >> > wind.document.w rite(html);
            >> >}
            >> ></script>
            >> ></head>
            >> ><body onload="myPage( )">
            >> ></body>
            >> ></html>
            >> >
            >> >window.open can accept parameters for greater control.
            >> >[/color]
            >>
            >>
            >>
            >> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
            >> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
            >> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]
            >
            >Here's one approach; watch for word-wrap.
            >
            ><html>
            ><head>
            ><title>TestPag e.htm</title>
            ></head>
            ><body>
            ><script type="text/javascript">
            > var sURL = "http://silvereaglenest .com/htmltestpage.ht m";
            > var sHTM = get_page(sURL);
            > alert(sHTM);
            > var wind = window.open();
            > wind.document.w rite(sHTM);
            >
            >function get_page(URL) {
            > var sTMP = "C:\\temp\\Test Page.tmp";
            > var oXML = new ActiveXObject(" Microsoft.XMLHT TP");
            > oXML.Open("Get" ,URL,false);
            > oXML.send();
            > var sXML = oXML.responseBo dy;
            > var oADO = new ActiveXObject(" ADODB.Stream");
            > oADO.Mode = 3;
            > oADO.Type = 1;
            > oADO.Open;
            > oADO.Write(sXML );
            > oADO.SaveToFile (sTMP,2);
            > var oFSO = new ActiveXObject(" Scripting.FileS ystemObject");
            > var oOTF = oFSO.OpenTextFi le(sTMP,1);
            > var sOTF = oOTF.ReadAll();
            > oOTF.Close();
            > oFSO.DeleteFile (sTMP);
            > return sOTF;
            >}
            ></script>
            ></body>
            ></html>
            >[/color]

            I tried the preceeding and get an "Error: Write to File Failed" on
            "oADO.SaveToFil e(sTMP,2)". Also, I thought you said I couldn't access
            client-side files since this page will be downloaded from a host, and
            that's why we were trying use of an array, as in my previous example.

            Thanks, don


            -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
            http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
            -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

            Comment

            • Lee

              #7
              Re: Can I use a temp file with client-side JavaScript?

              Don said:
              [color=blue]
              >
              >Well, I'm making progress, but have a little problem with the
              >following embedded script. It's supposed to read the body of a page
              >into an array, then open a window on which it is then displayed. I
              >have some debug "alert" statements embedded, and find the page body
              >(strPageBody ) is null after being read from the web site.[/color]

              [color=blue]
              ><html>
              ><head>
              ><title>Test</title>
              ><meta http-equiv="Content-Type" content="text/html;
              >charset=iso-8859-1">
              ></head>
              ><body>
              ><script language="JavaS cript" type="text/javascript">
              ><!--[/color]

              Get rid of that comment and it's mate. They're not needed, anymore.

              [color=blue]
              >//
              > var strPageURL = [];
              > var strPageBody = [];[/color]

              Here, you're declaring these variables as local arrays.
              Later you assign a string (not array) value to strPageURL,
              but you never assign any value to the local strPageBody.
              In the function get_page(), you assign a string value to an
              entirely different global variable with the same name.

              The simplest fix is to simply remove the line declaring
              strPageBody to be a local array. That way, only the global
              variable (containing a string) will exist, and that turns out
              to be what you want, in this case.

              [color=blue]
              >//
              >// Get page
              >//
              > strPageURL = "http://silvereaglenest .com/htmltestpage.ht m";
              > get_page (strPageURL);
              >//
              >// Display page
              >//
              > alert ("Body just before display: "+strPageBo dy);
              > var wind = window.open();
              > wind.document.w rite(strPageBod y);[/color]

              It's not safe to try to write into a window that you've just
              opened. The operating system may not have actually opened
              the new window, yet, at the time that you try to access its
              document. Use:

              window.open("ja vascript:opener .strPageBody");

              That will allow the new window to reach back into the current
              window and load the value of the *global* strPageBody variable
              as its content.



              [color=blue]
              >//
              >//
              > function get_page(strPag eURL)
              > {
              > var userName;
              > var password;
              > //
              > alert ("URL at start of function: "+strPageUR L);
              > alert ("Body at start of function: "+strPageBo dy);
              > var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
              > xmlhttp.Open("G et",strPageURL, false);
              > xmlhttp.send();
              > strPageBody = xmlhttp.respons eBody;
              > alert ("Body at end of function: "+strPageBo dy);
              > }
              >//-->
              ></script>
              ></body>
              ></html>[/color]

              Comment

              • Don

                #8
                Re: Can I use a temp file with client-side JavaScript?

                On Thu, 16 Sep 2004 08:11:26 -0700, Don <no@adr.com> wrote:
                [color=blue]
                >On Thu, 16 Sep 2004 14:42:29 GMT, "McKirahan" <News@McKirahan .com>
                >wrote:
                >[color=green]
                >>"Don" <no@adr.com> wrote in message
                >>news:jciik0pt cf9baphkheglcus bs1hq6cbvtc@4ax .com...[color=darkred]
                >>> Hi McKirahan,
                >>>
                >>> Well, I'm making progress, but have a little problem with the
                >>> following embedded script. It's supposed to read the body of a page
                >>> into an array, then open a window on which it is then displayed. I
                >>> have some debug "alert" statements embedded, and find the page body
                >>> (strPageBody) is null after being read from the web site. I've tried
                >>> just about everything I can think of. If I replace the "strPageBod y =
                >>> xmlhttp.respons eBody" statement with one that just fills strPageBody
                >>> with a char string it works. Any ideas?
                >>>
                >>> Thanks again, Don
                >>>
                >>>
                >>> <html>
                >>> <head>
                >>> <title>Test</title>
                >>> <meta http-equiv="Content-Type" content="text/html;
                >>> charset=iso-8859-1">
                >>> </head>
                >>> <body>
                >>> <script language="JavaS cript" type="text/javascript">
                >>> <!--
                >>> //
                >>> var strPageURL = [];
                >>> var strPageBody = [];
                >>> //
                >>> // Get page
                >>> //
                >>> strPageURL = "http://silvereaglenest .com/htmltestpage.ht m";
                >>> get_page (strPageURL);
                >>> //
                >>> // Display page
                >>> //
                >>> alert ("Body just before display: "+strPageBo dy);
                >>> var wind = window.open();
                >>> wind.document.w rite(strPageBod y);
                >>> //
                >>> //
                >>> function get_page(strPag eURL)
                >>> {
                >>> var userName;
                >>> var password;
                >>> //
                >>> alert ("URL at start of function: "+strPageUR L);
                >>> alert ("Body at start of function: "+strPageBo dy);
                >>> var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
                >>> xmlhttp.Open("G et",strPageURL, false);
                >>> xmlhttp.send();
                >>> strPageBody = xmlhttp.respons eBody;
                >>> alert ("Body at end of function: "+strPageBo dy);
                >>> }
                >>> //-->
                >>> </script>
                >>> </body>
                >>> </html>
                >>>
                >>>
                >>>
                >>>
                >>> On Wed, 15 Sep 2004 10:21:23 GMT, "McKirahan" <News@McKirahan .com>
                >>> wrote:
                >>>
                >>> >"Don" <no@adr.com> wrote in message
                >>> >news:4v1gk015o ddfnrgq30ameebm 7kiu190pga@4ax. com...
                >>> >> I'm writing an html page with some JavaScript that reads a web page
                >>> >> into a client-side temp file, then reformats it, then submits that
                >>> >> same file as a URL to the browser for display, via "locate.replace ".
                >>> >>
                >>> >> I can do all this if the html page containing the script originates
                >>> >> on the client machine, but don't know how to get access to a
                >>> >> client-side temp file when the same html page containing the script is
                >>> >> on a web host. How do I get access to a client-side temp file?
                >>> >>
                >>> >> or
                >>> >>
                >>> >> Is there some way I can use an array instead of a file to achieve the
                >>> >> same thing? If so, how do I submit the array as a URL for the browser
                >>> >> to display?
                >>> >>
                >>> >> Thanks,
                >>> >> Don
                >>> >>
                >>> >>
                >>> >> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                >>> >> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                >>> >> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
                >>> >
                >>> >Access to the client's file system (via FSO) raises an ActiveX security
                >>> >warning.
                >>> >
                >>> >You can use JavaScript to construct a Web page then use window.open().
                >>> >
                >>> >For example; watch for word-wrap.
                >>> >
                >>> ><html>
                >>> ><head>
                >>> ><title>myPage. htm</title>
                >>> ><script type="text/javascript">
                >>> >function myPage() {
                >>> > var html = "<html><head><t itle>My Page</title></head>";
                >>> > html += "<body>Hell o World</body></html>";
                >>> > var wind = window.open();
                >>> > wind.document.w rite(html);
                >>> >}
                >>> ></script>
                >>> ></head>
                >>> ><body onload="myPage( )">
                >>> ></body>
                >>> ></html>
                >>> >
                >>> >window.open can accept parameters for greater control.
                >>> >
                >>>
                >>>
                >>>
                >>> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                >>> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                >>> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]
                >>
                >>Here's one approach; watch for word-wrap.
                >>
                >><html>
                >><head>
                >><title>TestPa ge.htm</title>
                >></head>
                >><body>
                >><script type="text/javascript">
                >> var sURL = "http://silvereaglenest .com/htmltestpage.ht m";
                >> var sHTM = get_page(sURL);
                >> alert(sHTM);
                >> var wind = window.open();
                >> wind.document.w rite(sHTM);
                >>
                >>function get_page(URL) {
                >> var sTMP = "C:\\temp\\Test Page.tmp";
                >> var oXML = new ActiveXObject(" Microsoft.XMLHT TP");
                >> oXML.Open("Get" ,URL,false);
                >> oXML.send();
                >> var sXML = oXML.responseBo dy;
                >> var oADO = new ActiveXObject(" ADODB.Stream");
                >> oADO.Mode = 3;
                >> oADO.Type = 1;
                >> oADO.Open;
                >> oADO.Write(sXML );
                >> oADO.SaveToFile (sTMP,2);
                >> var oFSO = new ActiveXObject(" Scripting.FileS ystemObject");
                >> var oOTF = oFSO.OpenTextFi le(sTMP,1);
                >> var sOTF = oOTF.ReadAll();
                >> oOTF.Close();
                >> oFSO.DeleteFile (sTMP);
                >> return sOTF;
                >>}
                >></script>
                >></body>
                >></html>
                >>[/color]
                >
                >I tried the preceeding and get an "Error: Write to File Failed" on
                >"oADO.SaveToFi le(sTMP,2)". Also, I thought you said I couldn't access
                >client-side files since this page will be downloaded from a host, and
                >that's why we were trying use of an array, as in my previous example.
                >
                >Thanks, don
                >
                >
                >-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                >http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                >-----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]

                OOPS! I forgot to make sure I had a Temp folder at "C:"
                The foregoing works when the page is launched from my desktop, but not
                when run from my host, which is where I want to run it. Aren't I
                going to have to do this with an array, since file access isn't
                allowed from pages running from a host? If so, any idea why our array
                approach above didn't work?

                Thanks, Don


                -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

                Comment

                • Don

                  #9
                  Re: Can I use a temp file with client-side JavaScript?

                  On Thu, 16 Sep 2004 14:42:29 GMT, "McKirahan" <News@McKirahan .com>
                  wrote:
                  [color=blue]
                  >"Don" <no@adr.com> wrote in message
                  >news:jciik0ptc f9baphkheglcusb s1hq6cbvtc@4ax. com...[color=green]
                  >> Hi McKirahan,
                  >>
                  >> Well, I'm making progress, but have a little problem with the
                  >> following embedded script. It's supposed to read the body of a page
                  >> into an array, then open a window on which it is then displayed. I
                  >> have some debug "alert" statements embedded, and find the page body
                  >> (strPageBody) is null after being read from the web site. I've tried
                  >> just about everything I can think of. If I replace the "strPageBod y =
                  >> xmlhttp.respons eBody" statement with one that just fills strPageBody
                  >> with a char string it works. Any ideas?
                  >>
                  >> Thanks again, Don
                  >>
                  >>
                  >> <html>
                  >> <head>
                  >> <title>Test</title>
                  >> <meta http-equiv="Content-Type" content="text/html;
                  >> charset=iso-8859-1">
                  >> </head>
                  >> <body>
                  >> <script language="JavaS cript" type="text/javascript">
                  >> <!--
                  >> //
                  >> var strPageURL = [];
                  >> var strPageBody = [];
                  >> //
                  >> // Get page
                  >> //
                  >> strPageURL = "http://silvereaglenest .com/htmltestpage.ht m";
                  >> get_page (strPageURL);
                  >> //
                  >> // Display page
                  >> //
                  >> alert ("Body just before display: "+strPageBo dy);
                  >> var wind = window.open();
                  >> wind.document.w rite(strPageBod y);
                  >> //
                  >> //
                  >> function get_page(strPag eURL)
                  >> {
                  >> var userName;
                  >> var password;
                  >> //
                  >> alert ("URL at start of function: "+strPageUR L);
                  >> alert ("Body at start of function: "+strPageBo dy);
                  >> var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
                  >> xmlhttp.Open("G et",strPageURL, false);
                  >> xmlhttp.send();
                  >> strPageBody = xmlhttp.respons eBody;
                  >> alert ("Body at end of function: "+strPageBo dy);
                  >> }
                  >> //-->
                  >> </script>
                  >> </body>
                  >> </html>
                  >>
                  >>
                  >>
                  >>
                  >> On Wed, 15 Sep 2004 10:21:23 GMT, "McKirahan" <News@McKirahan .com>
                  >> wrote:
                  >>[color=darkred]
                  >> >"Don" <no@adr.com> wrote in message
                  >> >news:4v1gk015o ddfnrgq30ameebm 7kiu190pga@4ax. com...
                  >> >> I'm writing an html page with some JavaScript that reads a web page
                  >> >> into a client-side temp file, then reformats it, then submits that
                  >> >> same file as a URL to the browser for display, via "locate.replace ".
                  >> >>
                  >> >> I can do all this if the html page containing the script originates
                  >> >> on the client machine, but don't know how to get access to a
                  >> >> client-side temp file when the same html page containing the script is
                  >> >> on a web host. How do I get access to a client-side temp file?
                  >> >>
                  >> >> or
                  >> >>
                  >> >> Is there some way I can use an array instead of a file to achieve the
                  >> >> same thing? If so, how do I submit the array as a URL for the browser
                  >> >> to display?
                  >> >>
                  >> >> Thanks,
                  >> >> Don
                  >> >>
                  >> >>
                  >> >> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                  >> >> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                  >> >> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
                  >> >
                  >> >Access to the client's file system (via FSO) raises an ActiveX security
                  >> >warning.
                  >> >
                  >> >You can use JavaScript to construct a Web page then use window.open().
                  >> >
                  >> >For example; watch for word-wrap.
                  >> >
                  >> ><html>
                  >> ><head>
                  >> ><title>myPage. htm</title>
                  >> ><script type="text/javascript">
                  >> >function myPage() {
                  >> > var html = "<html><head><t itle>My Page</title></head>";
                  >> > html += "<body>Hell o World</body></html>";
                  >> > var wind = window.open();
                  >> > wind.document.w rite(html);
                  >> >}
                  >> ></script>
                  >> ></head>
                  >> ><body onload="myPage( )">
                  >> ></body>
                  >> ></html>
                  >> >
                  >> >window.open can accept parameters for greater control.
                  >> >[/color]
                  >>
                  >>
                  >>
                  >> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                  >> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                  >> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]
                  >
                  >Here's one approach; watch for word-wrap.
                  >
                  ><html>
                  ><head>
                  ><title>TestPag e.htm</title>
                  ></head>
                  ><body>
                  ><script type="text/javascript">
                  > var sURL = "http://silvereaglenest .com/htmltestpage.ht m";
                  > var sHTM = get_page(sURL);
                  > alert(sHTM);
                  > var wind = window.open();
                  > wind.document.w rite(sHTM);
                  >
                  >function get_page(URL) {
                  > var sTMP = "C:\\temp\\Test Page.tmp";
                  > var oXML = new ActiveXObject(" Microsoft.XMLHT TP");
                  > oXML.Open("Get" ,URL,false);
                  > oXML.send();
                  > var sXML = oXML.responseBo dy;
                  > var oADO = new ActiveXObject(" ADODB.Stream");
                  > oADO.Mode = 3;
                  > oADO.Type = 1;
                  > oADO.Open;
                  > oADO.Write(sXML );
                  > oADO.SaveToFile (sTMP,2);
                  > var oFSO = new ActiveXObject(" Scripting.FileS ystemObject");
                  > var oOTF = oFSO.OpenTextFi le(sTMP,1);
                  > var sOTF = oOTF.ReadAll();
                  > oOTF.Close();
                  > oFSO.DeleteFile (sTMP);
                  > return sOTF;
                  >}
                  ></script>
                  ></body>
                  ></html>
                  >[/color]

                  OOPS! I forgot to make sure I had a Temp folder at "C:"
                  The foregoing works when the page is launched from my desktop, but not
                  when run from my host, which is where I want to run it. Aren't I
                  going to have to do this with an array, since file access isn't
                  allowed from pages running from a host? If so, any idea why our array
                  approach above didn't work?

                  Thanks, Don


                  -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                  http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                  -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

                  Comment

                  • McKirahan

                    #10
                    Re: Can I use a temp file with client-side JavaScript?

                    [snip]
                    [color=blue]
                    > OOPS! I forgot to make sure I had a Temp folder at "C:"
                    > The foregoing works when the page is launched from my desktop, but not
                    > when run from my host, which is where I want to run it. Aren't I
                    > going to have to do this with an array, since file access isn't
                    > allowed from pages running from a host? If so, any idea why our array
                    > approach above didn't work?
                    >
                    > Thanks, Don[/color]

                    I'm not doing a very good job of understanding your task.

                    Initially, I showed you how to open a window which answered one of your
                    questions:
                    "how do I submit the array as a URL for the browser to display?"

                    Subsequently, I showed you how to get the page source captured via XMLHTTP
                    which addressed the issue of "I ... find the page body (strPageBody) is
                    null".

                    Anyway, could you describe your task in more discreet steps? Thanks.


                    Comment

                    • Don

                      #11
                      Re: Can I use a temp file with client-side JavaScript?

                      On Thu, 16 Sep 2004 17:15:19 GMT, "McKirahan" <News@McKirahan .com>
                      wrote:
                      [color=blue]
                      >[snip]
                      >[color=green]
                      >> OOPS! I forgot to make sure I had a Temp folder at "C:"
                      >> The foregoing works when the page is launched from my desktop, but not
                      >> when run from my host, which is where I want to run it. Aren't I
                      >> going to have to do this with an array, since file access isn't
                      >> allowed from pages running from a host? If so, any idea why our array
                      >> approach above didn't work?
                      >>
                      >> Thanks, Don[/color]
                      >
                      >I'm not doing a very good job of understanding your task.
                      >
                      >Initially, I showed you how to open a window which answered one of your
                      >questions:
                      >"how do I submit the array as a URL for the browser to display?"
                      >
                      >Subsequently , I showed you how to get the page source captured via XMLHTTP
                      >which addressed the issue of "I ... find the page body (strPageBody) is
                      >null".
                      >
                      >Anyway, could you describe your task in more discreet steps? Thanks.
                      >[/color]

                      I'm sorry I haven't been clear enough on what I'm trying to do.
                      Here's an outline:
                      - page will run on client's machine from host
                      - page does the following:
                      - reads a specific web page
                      - modifies that page (none of my code presented to you has
                      addressed this step yet.)
                      - then presents the modified page to the client in the same browser
                      window opened by this page in the first place.

                      I hope this is clearer.
                      Thanks for your help.
                      Don


                      -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                      http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                      -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

                      Comment

                      • McKirahan

                        #12
                        Re: Can I use a temp file with client-side JavaScript?

                        [snip]
                        [color=blue]
                        > I'm sorry I haven't been clear enough on what I'm trying to do.
                        > Here's an outline:
                        > - page will run on client's machine from host
                        > - page does the following:
                        > - reads a specific web page
                        > - modifies that page (none of my code presented to you has
                        > addressed this step yet.)
                        > - then presents the modified page to the client in the same browser
                        > window opened by this page in the first place.
                        >
                        > I hope this is clearer.
                        > Thanks for your help.
                        > Don
                        >
                        >
                        > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                        > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                        > -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]

                        Can you describe an example of this? Thanks.


                        Comment

                        • Don

                          #13
                          Re: Can I use a temp file with client-side JavaScript?

                          On Thu, 16 Sep 2004 18:59:57 GMT, "McKirahan" <News@McKirahan .com>
                          wrote:
                          [color=blue]
                          >[snip]
                          >[color=green]
                          >> I'm sorry I haven't been clear enough on what I'm trying to do.
                          >> Here's an outline:
                          >> - page will run on client's machine from host
                          >> - page does the following:
                          >> - reads a specific web page
                          >> - modifies that page (none of my code presented to you has
                          >> addressed this step yet.)
                          >> - then presents the modified page to the client in the same browser
                          >> window opened by this page in the first place.
                          >>
                          >> I hope this is clearer.
                          >> Thanks for your help.
                          >> Don
                          >>
                          >>
                          >> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                          >> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                          >> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]
                          >
                          >Can you describe an example of this? Thanks.
                          >[/color]
                          I'm not sure I've seen something like this before. What I'm trying to
                          do is provide a better presentation of an exsisting aviation chat
                          group message page, including a way to attach images. The existing
                          chat message page is very primitive. On my modified page I will have
                          a form allowing the client to add images before he clicks to post the
                          message. My script will copy the images to my host server, where a
                          PHP script will store it on the server. This client-side script I am
                          trying to write will also build in the html code to reference the
                          images. Then it will actually post it just as normal chat messages
                          are posted.

                          In the client-side script you are helping me with, I just need to get
                          past the point where I can read the chat index page, and be able to
                          display it in the same browser window the script itself is running in.
                          Note, the script we are working with doesn't actually reference the
                          chat page, but instead contains just test data.

                          Does this help?
                          Don


                          -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                          http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                          -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

                          Comment

                          • Don

                            #14
                            Re: Can I use a temp file with client-side JavaScript?

                            On Thu, 16 Sep 2004 12:18:46 -0700, Don <no@adr.com> wrote:
                            [color=blue]
                            >On Thu, 16 Sep 2004 18:59:57 GMT, "McKirahan" <News@McKirahan .com>
                            >wrote:
                            >[color=green]
                            >>[snip]
                            >>[color=darkred]
                            >>> I'm sorry I haven't been clear enough on what I'm trying to do.
                            >>> Here's an outline:
                            >>> - page will run on client's machine from host
                            >>> - page does the following:
                            >>> - reads a specific web page
                            >>> - modifies that page (none of my code presented to you has
                            >>> addressed this step yet.)
                            >>> - then presents the modified page to the client in the same browser
                            >>> window opened by this page in the first place.
                            >>>
                            >>> I hope this is clearer.
                            >>> Thanks for your help.
                            >>> Don
                            >>>
                            >>>
                            >>> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                            >>> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                            >>> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]
                            >>
                            >>Can you describe an example of this? Thanks.
                            >>[/color]
                            >I'm not sure I've seen something like this before. What I'm trying to
                            >do is provide a better presentation of an exsisting aviation chat
                            >group message page, including a way to attach images. The existing
                            >chat message page is very primitive. On my modified page I will have
                            >a form allowing the client to add images before he clicks to post the
                            >message. My script will copy the images to my host server, where a
                            >PHP script will store it on the server. This client-side script I am
                            >trying to write will also build in the html code to reference the
                            >images. Then it will actually post it just as normal chat messages
                            >are posted.
                            >
                            >In the client-side script you are helping me with, I just need to get
                            >past the point where I can read the chat index page, and be able to
                            >display it in the same browser window the script itself is running in.
                            >Note, the script we are working with doesn't actually reference the
                            >chat page, but instead contains just test data.
                            >
                            >Does this help?
                            >Don
                            >
                            >
                            >-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                            >http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                            >-----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]

                            I just don't understand why "strPageBod y" in the script below was null
                            after the read. If I could only get this script working, I think I'd
                            have the battle won.
                            [color=blue][color=green][color=darkred]
                            >>> <html>
                            >>> <head>
                            >>> <title>Test</title>
                            >>> <meta http-equiv="Content-Type" content="text/html;
                            >>> charset=iso-8859-1">
                            >>> </head>
                            >>> <body>
                            >>> <script language="JavaS cript" type="text/javascript">
                            >>> <!--
                            >>> //
                            >>> var strPageURL = [];
                            >>> var strPageBody = [];
                            >>> //
                            >>> // Get page
                            >>> //
                            >>> strPageURL = "http://silvereaglenest .com/htmltestpage.ht m";
                            >>> get_page (strPageURL);
                            >>> //
                            >>> // Display page
                            >>> //
                            >>> alert ("Body just before display: "+strPageBo dy);
                            >>> var wind = window.open();
                            >>> wind.document.w rite(strPageBod y);
                            >>> //
                            >>> //
                            >>> function get_page(strPag eURL)
                            >>> {
                            >>> var userName;
                            >>> var password;
                            >>> //
                            >>> alert ("URL at start of function: "+strPageUR L);
                            >>> alert ("Body at start of function: "+strPageBo dy);
                            >>> var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
                            >>> xmlhttp.Open("G et",strPageURL, false);
                            >>> xmlhttp.send();
                            >>> strPageBody = xmlhttp.respons eBody;
                            >>> alert ("Body at end of function: "+strPageBo dy);
                            >>> }
                            >>> //-->
                            >>> </script>
                            >>> </body>
                            >>> </html>[/color][/color][/color]


                            -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                            http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                            -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

                            Comment

                            • McKirahan

                              #15
                              Re: Can I use a temp file with client-side JavaScript?

                              "Don" <no@adr.com> wrote in message
                              news:fqpjk0lp33 4nqtse3qsfc582s vtiv1ncit@4ax.c om...[color=blue]
                              > On Thu, 16 Sep 2004 12:18:46 -0700, Don <no@adr.com> wrote:
                              >[color=green]
                              > >On Thu, 16 Sep 2004 18:59:57 GMT, "McKirahan" <News@McKirahan .com>
                              > >wrote:
                              > >[color=darkred]
                              > >>[snip]
                              > >>
                              > >>> I'm sorry I haven't been clear enough on what I'm trying to do.
                              > >>> Here's an outline:
                              > >>> - page will run on client's machine from host
                              > >>> - page does the following:
                              > >>> - reads a specific web page
                              > >>> - modifies that page (none of my code presented to you has
                              > >>> addressed this step yet.)
                              > >>> - then presents the modified page to the client in the same browser
                              > >>> window opened by this page in the first place.
                              > >>>
                              > >>> I hope this is clearer.
                              > >>> Thanks for your help.
                              > >>> Don
                              > >>>
                              > >>>
                              > >>> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                              > >>> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                              > >>> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
                              > >>
                              > >>Can you describe an example of this? Thanks.
                              > >>[/color]
                              > >I'm not sure I've seen something like this before. What I'm trying to
                              > >do is provide a better presentation of an exsisting aviation chat
                              > >group message page, including a way to attach images. The existing
                              > >chat message page is very primitive. On my modified page I will have
                              > >a form allowing the client to add images before he clicks to post the
                              > >message. My script will copy the images to my host server, where a
                              > >PHP script will store it on the server. This client-side script I am
                              > >trying to write will also build in the html code to reference the
                              > >images. Then it will actually post it just as normal chat messages
                              > >are posted.
                              > >
                              > >In the client-side script you are helping me with, I just need to get
                              > >past the point where I can read the chat index page, and be able to
                              > >display it in the same browser window the script itself is running in.
                              > >Note, the script we are working with doesn't actually reference the
                              > >chat page, but instead contains just test data.
                              > >
                              > >Does this help?
                              > >Don
                              > >
                              > >
                              > >-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                              > >http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                              > >-----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]
                              >
                              > I just don't understand why "strPageBod y" in the script below was null
                              > after the read. If I could only get this script working, I think I'd
                              > have the battle won.
                              >[color=green][color=darkred]
                              > >>> <html>
                              > >>> <head>
                              > >>> <title>Test</title>
                              > >>> <meta http-equiv="Content-Type" content="text/html;
                              > >>> charset=iso-8859-1">
                              > >>> </head>
                              > >>> <body>
                              > >>> <script language="JavaS cript" type="text/javascript">
                              > >>> <!--
                              > >>> //
                              > >>> var strPageURL = [];
                              > >>> var strPageBody = [];
                              > >>> //
                              > >>> // Get page
                              > >>> //
                              > >>> strPageURL = "http://silvereaglenest .com/htmltestpage.ht m";
                              > >>> get_page (strPageURL);
                              > >>> //
                              > >>> // Display page
                              > >>> //
                              > >>> alert ("Body just before display: "+strPageBo dy);
                              > >>> var wind = window.open();
                              > >>> wind.document.w rite(strPageBod y);
                              > >>> //
                              > >>> //
                              > >>> function get_page(strPag eURL)
                              > >>> {
                              > >>> var userName;
                              > >>> var password;
                              > >>> //
                              > >>> alert ("URL at start of function: "+strPageUR L);
                              > >>> alert ("Body at start of function: "+strPageBo dy);
                              > >>> var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
                              > >>> xmlhttp.Open("G et",strPageURL, false);
                              > >>> xmlhttp.send();
                              > >>> strPageBody = xmlhttp.respons eBody;
                              > >>> alert ("Body at end of function: "+strPageBo dy);
                              > >>> }
                              > >>> //-->
                              > >>> </script>
                              > >>> </body>
                              > >>> </html>[/color][/color]
                              >
                              >
                              > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                              > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                              > -----== Over 100,000 Newsgroups - 19 Different Servers! =-----[/color]

                              Change ".responseB ody" to ".responseText" .


                              Save the following as "test.js" then double-click on it.

                              var sURL = "http://www.Google.com/index.html";
                              var xmlhttp = new ActiveXObject(" Msxml2.XMLHTTP. 3.0");
                              xmlhttp.open("G ET", sURL, false);
                              xmlhttp.send();
                              WScript.Echo(xm lhttp.responseB ody);
                              WScript.Echo(xm lhttp.responseT ext);


                              Take a look at this link:

                              http://msdn.microsoft.com/library/de...us/xmlsdk/html
                              /xmproresponsebo dyixmlhttpreque st.asp

                              Under "Remarks" (for ResponseBody) it states:

                              "This contains the raw undecoded bytes as received directly from the
                              server."


                              Comment

                              Working...