Help needed for non-Javascript programmer!

J

John Grogan

I have absolutely no experience in Javascript although am a programmer by
trade.

I have a problem in a third-party system, as follows.

The system uses "web" forms to capture and save data. When the form
is called up it should "remember" some field contents from previous
sessions. It works intermittently, other times produces "error on
page" errors. I have narrowed it down to some lines in a Javascript
script that is called when opening the form and closing (saving the
data). The line is :-

form_data.load("EID_Settings")

or

form_data.save("EID_Settings")

I believe it is trying to load from an XML file. The problems seem to
be related to permissions on Windows XP. The XML file is saved to the
cache of the first user to run the system, therefore other users can't
access it. I have tried moving the cache for all users to a central
location - still doesn't work (I get a message about the "Internet
extensions").

Is there a way I can force the script to read and write from a
specifically named file (e.g. c:\app\eid_settings.xml) rather than use
the cache?

Any help greatly appreciated!
 
K

kaeli

Is there a way I can force the script to read and write from a
specifically named file (e.g. c:\app\eid_settings.xml) rather than use
the cache?

No, javascript has no such permissions normally. You'd need special
permissions to write to a user's hard drive with signed scripts.
Actually, I know applets can do it, but I'm not sure JS can at all. Too
many malicious people would take advantage of such a thing.

You should never count on the cache. Users often empty it. Some of us
have it set to 0 so nothing ever caches.

Use cookies or session variables (often in conjunction with a DB table)
to save user settings.

-------------------------------------------------
~kaeli~
All I ask for is the chance to prove that money
cannot make me happy.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
 
H

Horace A. Vallas, Jr.

if it's a script permission problem that requires signing the code for
additional privilege, you can find info for Mozilla/netscape at...

http://www.mozilla.org/projects/security/components/signed-scripts.html
http://docs.sun.com/source/816-6164-10/signscpt.htm

will probably need another approach for IE users (at least java requires
different signing for the netscape, IE (and the plugin though the plugin
can use .jar's signed for netscape)

some IE info for applet signing is at...

http://www.suitable.com/docs/signingsignexp.html

or just goggle for how to sign applets and/or javascript

can probably jar and cab the script and sign like applets, then include the
signed script wih src="whatever"... where whatever is the appropriately
signed jar (or cab) As a note, IE can use .jar's but not signed .jar's
(at least, for applets)

John said:
I have absolutely no experience in Javascript although am a programmer by
trade.

I have a problem in a third-party system, as follows.

The system uses "web" forms to capture and save data. When the form
is called up it should "remember" some field contents from previous
sessions. It works intermittently, other times produces "error on
page" errors. I have narrowed it down to some lines in a Javascript
script that is called when opening the form and closing (saving the
data). The line is :-

form_data.load("EID_Settings")

or

form_data.save("EID_Settings")

I believe it is trying to load from an XML file. The problems seem to
be related to permissions on Windows XP. The XML file is saved to the
cache of the first user to run the system, therefore other users can't
access it. I have tried moving the cache for all users to a central
location - still doesn't work (I get a message about the "Internet
extensions").

Is there a way I can force the script to read and write from a
specifically named file (e.g. c:\app\eid_settings.xml) rather than use
the cache?

Any help greatly appreciated!

--
Horace ...once known as "Kicker" :)
================================================================
....drop by and chat if I'm online http://www.hav.com/chat/
================================================================
Horace Vallas hav.Software http://www.hav.com/
P.O. Box 354 (e-mail address removed)
Richmond, Tx. 77406-0354 voice: 281-341-5035
USA fax: 281-341-5087

Thawte Web Of Trust Notary in SW Houston, Tx.
http://www.hav.com/?content=/thawteWOTnotary.htm
================================================================
What is a Vet? ... He is the barroom loudmouth, dumber than five
wooden planks, whose overgrown frat-boy behavior is outweighed a
hundred times in the cosmic scales by four hours of exquisite
bravery near the 38th parallel. ... - Unknown
================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top