
December 15th, 2005, 05:00 PM
|
|
Registered User
|
|
Join Date: Oct 2005
Posts: 28
Time spent in forums: 6 h 5 m 43 sec
Reputation Power: 0
|
|
WYSIWYG editor file opening (only try and answer if you know about the fso in js)
hi, I'm building a WYSIWYG editor with an iFrame, the file open feature wont work though, here is my code (and the richify and scriptify functions just switch modes)
Code:
var fso = new ActiveXObject("Scripting.FileSystemObject")
function readFile(file)
{
var fileObj = fso.OpenTextFile(file, 1)
var fileText = fileObj.ReadAll()
if (type == "w")
{
iFrame.document.close()
while (!fileObj.AtEndOfStream)
{
document.iFrame.document.write(fileObj.ReadLine())
}
scriptify(); richify();
}
if (type == "s")
{
richify();
readFile(file);
scriptify();
}
fileObj.close();
}
when you call the richify function, the type turns to "w" and the mode goes into WYSIWYG editing mode, scriptify changes type to "s" and changes the mode to HTML edit, there's nothing wrong with the richify and scriptify functions because i see them working well when i do this function, what goes wrong with the function?? 
|