Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > ini file access

Reply
Thread Tools

ini file access

 
 
pat
Guest
Posts: n/a
 
      12-13-2003
hi all.

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

thanx in advance

pat



 
Reply With Quote
 
 
 
 
Michael Winter
Guest
Posts: n/a
 
      12-14-2003
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
http://www.velocityreviews.com/forums/(E-Mail Removed)d (replace ".invalid" with ".uk")
 
Reply With Quote
 
 
 
 
Bart Van der Donck
Guest
Posts: n/a
 
      12-14-2003
> 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
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      12-14-2003
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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot.ini not in root? Where is Boot.ini for Win 2000 pro? rosalind8109@nospamrodadrunner.net Computer Support 15 02-03-2007 03:39 AM
help, CABROTOR found, win.ini access denied Guy Noir - private eye Computer Support 0 11-03-2004 01:24 AM
ini file Sphinx ASP .Net 2 02-25-2004 01:34 PM
INI file access from Ruby Stephan Kämper Ruby 2 08-28-2003 07:28 PM
Update INI file problem chapman ASP .Net 0 07-31-2003 03:59 AM



Advertisments