954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Smart Mind "SCRIPT to Write Text files"

By iamrashid on Aug 5th, 2006 11:00 am

It is a simple one and a more complex one will be here soon
this code has not been tested but it works well on IE 6.0+
Do enjoy and Comment it Please

<script>
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.CreateTextFile("test.htm", true);
//--varibles-- starts.
 
//--variables--ends.
var bgcolor="red"
s.WriteLine('<html>');
//To enter more than one arguments (i-e simple and a variable or special character we can use the "+" sign )
s.WriteLine('<body bgcolor='+bgcolor+'>');


s.WriteLine('</body>');
s.WriteLine('</html>');
s.Close();
</script>

but how to use it

sriluk249
Newbie Poster
1 post since May 2009
Reputation Points: 10
Solved Threads: 0
 
vmars
Junior Poster in Training
54 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

');


s.WriteLine('

vmars
Junior Poster in Training
54 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

I even tried changing the above script:

vmars
Junior Poster in Training
54 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You