you can use ActiveX to read a text file that is on the client. That is if the client has ActiveX scripting enabled.
____________________________________________________ get the best answer to your questions by asking the best questions "General FAQ" faq333-2924
eg:
<script language="JavaScript">
var fso;
var txtVals;
fso = new ActiveXObject("Scripting.FileSystemObject"
f = fspenTextFile("textfile.txt", 1);
txtVals = f.ReadAll();
f.Close()
document.write txtVals
</script>
along those lines
____________________________________________________ get the best answer to your questions by asking the best questions "General FAQ" faq333-2924
____________________________________________________ get the best answer to your questions by asking the best questions "General FAQ" faq333-2924
____________________________________________________ get the best answer to your questions by asking the best questions "General FAQ" faq333-2924
loggos is the one who should answe your question xutpia, but I am also interested. I have an example problem that could use the reading of a text file:
I have a complex(is a pain to copy/paste and and update would require me to edit EVERY page's menu code to match with the others) menu system that resides at the top of the page. I do not want to put this menu system in a frame. I also do not have any server-side scripting capabilities. How could I extract the menu's code out of a text file and have it put into the top portion of the output html file?
xutopia, I hoped you knew I didn't have to be told that. I practice browser complient development while working. It is always considered.
I think the only thing I've ever put on a site that wasn't compatable with most browsers (versions exlluded) was a div on my site that I have thus rewritten to provide other browsers to view them. (time given implementation)
My answer was the only I knew how this could be done. There are some closed doors situations that could ahve benifited from the reply
____________________________________________________ get the best answer to your questions by asking the best questions "General FAQ" faq333-2924
Thanks for explaining yourself. I'm under linux at the moment (except at work where my bosses are pissed off that they can't migrate to linux because of lock-ins by M$).
I'm advocating this to everyone I can that we should move away from non-standard stuff especially with people I know can understand.
I should take diplomacy lessons if I plan to change the world. LOL
The problem as you pose it can be solved several ways. The way I suggested is to make it an HTML file. In this case, you would use frames.
Your menu would reside in a header frame. An iframe might work as well -- I have no experience with those.
I'd recommend against frames in general, though, for a variety of reasons.
There are tools, by the way, that allow for bulk search-n-replace. They make up for Windows woeful lack of a common grep function. I use a little tool called "Windows Search and Replace":
What you could do is create whatever HTML code you need common for all your pages and create a javascript function that generates that code for you.
this way the only thing you have to do is call the function at the top of every page.If changes are needed just change the original HTML code and since the function name is not changing your pages will automatically pick up the new code.
Now it's not necessary for you to manually create the code everytime you want the changes. you could use "Javascript generators" that will create all the Javascript for you based on the HTML code you pass them..
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.