Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - problem download HTML in JavaScript

Reply
 
Old 08-31-2009   #1 (permalink)


Vista Home Premium
 
 

problem download HTML in JavaScript

//***********************
// Test of downloading HTML DOM object
// Gets title OK as shown
// Does not get title if WScript.echo is commented out
// running on VISTA Home Premium Service Pack 1
//***********************

var fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
var logFile = fso.CreateTextFile("logTestHTML.txt", true);
var URL;
var domHtml;
URL = "http://google.com";
logFile.writeLine("getting HTML: " + URL);
domHtml= WScript.getObject(URL);
WScript.echo("got HTML");
logFile.writeLine("title: " + domHtml.title);

My System SpecsSystem Spec
Old 08-31-2009   #2 (permalink)
mayayana


 
 

Re: problem download HTML in JavaScript

You didn't notice that the newsgroup name
says "vbscript"? For javascript you need to ask
in the javascript group.
Quote:

> // Test of downloading HTML DOM object
> // Gets title OK as shown
> // Does not get title if WScript.echo is commented out
> // running on VISTA Home Premium Service Pack 1
> file://***********************
>
> var fso;
> fso = new ActiveXObject("Scripting.FileSystemObject");
> var logFile = fso.CreateTextFile("logTestHTML.txt", true);
> var URL;
> var domHtml;
> URL = "http://google.com";
> logFile.writeLine("getting HTML: " + URL);
> domHtml= WScript.getObject(URL);
> WScript.echo("got HTML");
> logFile.writeLine("title: " + domHtml.title);
>
>
> --
> captain kris

My System SpecsSystem Spec
Old 08-31-2009   #3 (permalink)


Vista Home Premium
 
 

Re: problem download HTML in JavaScript

Sorry posted wrong script - I tried both scripting languages

'//***********************
'// Test of downloading HTML DOM object
'// Gets title OK as shown
'// Does not get title if WScript.echo is commented out
'// running on VISTA Home Premium Service Pack 1
'//***********************

dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
dim logFile
Set logFile = fso.CreateTextFile("logTestHTML.txt", true)
dim URL
dim domHtml
'Set URL = "http://google.com"
logFile.writeLine("getting HTML: http://google.com")
Set domHtml= WScript.getObject("http://google.com")
WScript.echo("got HTML")
logFile.writeLine("title: " & domHtml.title)
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
problem download HTML in VBScript VB Script
Internet Explorer Problem *HELP* Maybe a Javascript problem Browsers & Mail
Seeking CSS, Javascript, HTML, PHP editor component.... .NET General
FREE Tutorials on HTML XHTML CSS JavaScript XML XSL ASP SQL ADOVBScript, SAP - ABAP and more... Vista General
Download ASPX wiki pages as HTML PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46