469,927 Members | 1,893 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

ini file access

pat
hi all.

am trying to find out how to read/load data from an ini file (and save it
too)

thanx in advance

pat

Jul 20 '05 #1
3 8379
pat wrote on 13 Dec 2003 at Sat, 13 Dec 2003 23:38:32 GMT:
am trying to find out how to read/load data from an ini file
(and save it too)


Certain browsers might be able to read the data into a variable as a
string (I forget how), but they certainly cannot save it again.
JavaScript wasn't developed to do that sort of thing.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk")
Jul 20 '05 #2
> am trying to find out how to read/load data from an ini file (and save it
too)


Only if your .ini file resides on the same domain, you can read it by
javascript in modern browsers. A popular technique is the use of
iframes:

<iframe src="C:\YOUR_INI_FILE.INI"></iframe>

Saving back is not possible. You 'll need a server process for that.

Bart
Jul 20 '05 #3
Bart Van der Donck wrote:
am trying to find out how to read/load data from an ini file (and save it
too)
Only if your .ini file resides on the same domain, you can read it by
javascript in modern browsers. A popular technique is the use of
iframes:

<iframe src="C:\YOUR_INI_FILE.INI"></iframe>


<OT>

JFTR:

If you consider `localhost' a domain and you dare call IE a "modern
browser" this might work. Generally, not backslashes serve the purpose
of path delimiters in URIs but forward slashes do. And a URI scheme
identifier is missing, too, Mozilla/5.0 for example will probably not
show anything (at least it will only work on Windows.)

<iframe src="file:///C:/YOUR_INI_FILE.INI"></iframe>

could work on Windows as well as

<iframe src="YOUR_INI_FILE.INI"></iframe>

could do everywhere. However, the former will only work if the
parent document is accessed via the local file system or if the UA
is borken/unpatched. AFAIK & IIRC, for Mozilla/5.0 the bug has
been fixed in rv:1.4 (CMIIW), and thus access from `http:' to
`file:' is no longer possible.
Saving back is not possible. You 'll need a server process for that.


Just to clarify: Server processes cannot and will not access the
`iframe' element (since it is rendered client-side), but the
resource it refers to.

</OT>
PointedEars
--
apprentice.c - parses /etc/magic to learn magic

(from the file-3.40 README)
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Joe Costa | last post: by
11 posts views Thread by sur | last post: by
16 posts views Thread by Eran.Yasso | last post: by
5 posts views Thread by =?Utf-8?B?QWRyaWFuTW9ycmlz?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.