Forum Moderators: open
Can a text document be read by javascript and output to a html page?
I mean without pulling a text file into an I frame or something similar is there any client side way to have a text file output into an html page so it can have html formatting ie. retain body font etc so that a client can just make changes to the text file?
There is a lot to choose from in CMS -- MacroMedia's Contribute offers something like what you describe for at a modest price, and there are blogging scripts that may also suit your purpose that are freeware.
tedster is right, of course. You can't use javascript for what you describe. Javascript doesn't manipulate (read/write) files except for cookies, as it is client side, and allowing file access would compromise security.
Could you describe a bit more of what you are trying to achieve, and perhaps someone can help. For example, you want the file to be on the visitor's machine? So the visitor can change their own file, but no one else would ever see the results? Is the information small enough to fit into a cookie file? Is this on an Intranet, or for a general Internet site?
Like you have
..
/
/users/
/users/bob
/users/mary
You make templates that reside in "/" and include text files from "/users/bob" or "/users/mary" &c.
E.g.,
<html>
<head>
<title>Bob's Page</title>
</head>
<body>
<!--#include virtual="/users/bob/bob.txt" -->
</body>
</html>
Wouldn't something like that work (assuming the server supports SSI)? I know next to nothing about server side stuff, but I think that would work...
Jordan
What I was hoping to do was to have it so a client could create a text file with a certain name and ftp it to the server where it would be included on a dhtml page.
Server side is out of the question for this particular site because of the type of hosting.
and I did not want the plain text look that using an iframe would provide.
Why don't you want one with a database? There's nothing scary about using a database. Sure the hosting is a bit more than those cut-down budget hosting plans, but on the other hand you'll probably get heaps more bandwith thrown in.
This is only for future reference for server side options.
Just thought that there may be some more popular of the free ones to save me the time of evaluating quite a few.:)