Adobe 38040334 - Dreamweaver CS3 User Manual page 19

Api reference
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

Description
This function writes the specified string to the specified file. If the specified file does not yet exist, it is created.
Arguments
fileURL, text, {mode}
• The
argument, which is expressed as a file:// URL, is the file to which you are writing.
fileURL
• The
argument is the string to be written.
text
• The
argument, if it is supplied, must be
mode
overwritten by the string.
Returns
A Boolean value:
if the string is successfully written to the file;
true
Example
The following code attempts to write the string
operation succeeds. It then tries to append the string
succeeds. After executing this script, the mydata.txt file contains the text
var fileURL = "file:///c|/temp/mydata.txt";
if (DWfile.write(fileURL, "xxx")){
alert("Wrote xxx to " + fileURL);
}
if (DWfile.write(fileURL, "aaa", "append")){
alert("Appended aaa to " + fileURL);
}
. If this argument is omitted, the contents of the file are
"append"
false
to the mydata.txt file and displays an alert message if the write
"xxx"
to the file and displays a second alert if the write
"aaa"
otherwise.
and nothing else.
xxxaaa
DREAMWEAVER CS3
14
API Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents