Re: Can I use a temp file with client-side JavaScript?
On Thu, 16 Sep 2004 20:03:50 GMT, "McKirahan" <News@McKirahan .com>
wrote:
[color=blue]
>"Don" <no@adr.com> wrote in message
>news:fqpjk0lp3 34nqtse3qsfc582 svtiv1ncit@4ax. com...[color=green]
>> On Thu, 16 Sep 2004 12:18:46 -0700, Don <no@adr.com> wrote:
>>[color=darkred]
>> >On Thu, 16 Sep 2004 18:59:57 GMT, "McKirahan" <News@McKirahan .com>
>> >wrote:
>> >
>> >>[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.
>> >>
>> >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=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]
>>
>>
>> -----= 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(x mlhttp.response Body);
>WScript.Echo(x mlhttp.response Text);
>
>
>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."
>[/color]
That's it, you've got it! I changed it in the following script, and
it works just great now. THANK YOU! THANK YOU!
I was hoping to have the display occur on the same browser window that
this page runs under, so the client can utilize the "back" button if
he wants. Any idea how to do that?
Thanks much for all your help. Sure nice to have these newsgroups.
Don't know what I'd do without them.
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;
//
// Get page
//
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 eText;
alert ("Body at end of function: "+strPageBo dy);
}
//-->
</script>
</body>
</html>
-----= 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! =-----
On Thu, 16 Sep 2004 20:03:50 GMT, "McKirahan" <News@McKirahan .com>
wrote:
[color=blue]
>"Don" <no@adr.com> wrote in message
>news:fqpjk0lp3 34nqtse3qsfc582 svtiv1ncit@4ax. com...[color=green]
>> On Thu, 16 Sep 2004 12:18:46 -0700, Don <no@adr.com> wrote:
>>[color=darkred]
>> >On Thu, 16 Sep 2004 18:59:57 GMT, "McKirahan" <News@McKirahan .com>
>> >wrote:
>> >
>> >>[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.
>> >>
>> >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=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]
>>
>>
>> -----= 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(x mlhttp.response Body);
>WScript.Echo(x mlhttp.response Text);
>
>
>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."
>[/color]
That's it, you've got it! I changed it in the following script, and
it works just great now. THANK YOU! THANK YOU!
I was hoping to have the display occur on the same browser window that
this page runs under, so the client can utilize the "back" button if
he wants. Any idea how to do that?
Thanks much for all your help. Sure nice to have these newsgroups.
Don't know what I'd do without them.
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;
//
// Get page
//
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 eText;
alert ("Body at end of function: "+strPageBo dy);
}
//-->
</script>
</body>
</html>
-----= 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