Hi there.
OK, this is a little bit complicated.
I would live to find a different way to do this, but evidentially I am not able
to open a Text-File in JAVASCRIPT and fill an Array with the Values, so I have
to do it this way.
I am doing the following:
I use a File called "ApplicationResources.properties" containing 2 columns
"message" & "content" with a FieldDelim "=".
This File contains Values for Labels in different Languages, so I can change
the Language always depending on the Browser-Language.
I have one for every language. (ApplicationResources.properties for English,
ApplicationResources_de.properties for German ...)
I have a an Object looking like this:
<OBJECT id="ApplicationResources"
classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
<PARAM name="DataURL" value="properties/ApplicationResources.properties">
<PARAM name="UseHeader" value="true">
<PARAM name="FieldDelim" value="=">
<PARAM name="Filter" value="">
</OBJECT>
I do change the value for the "DataURL" always depending on the
Browser-Language.
document.getElementById("ApplicationResources").ob ject.DataURL =
"ApplicationResources" + strBrowerLang + ".properties";
document.getElementById("ApplicationResources").Re set();
I use this Object, to read the Data from the Recordset in changing the Filter
by using the following function:
function BeanMessage(strMessage) {
document.getElementById("ApplicationResources").ob ject.Filter = "message=" +
strMessage;
document.getElementById("ApplicationResources").Re set();
strValue =
document.getElementById("ApplicationResources").re cordset.Fields("content"
).value;
return (strValue);
}
Within my BODY I use this for example:
<P>
<SCRIPT
type="text/javascript">document.write(BeanMessage("start.expl ain.1"));</SC
RIPT><BR>
<SCRIPT
type="text/javascript">document.write(BeanMessage("start.expl ain.2"));</SC
RIPT><BR>
<SCRIPT
type="text/javascript">document.write(BeanMessage("start.expl ain.3"));</SC
RIPT><BR>
</P>
This works perfectly fine when using the site locally on my computer, but as
soon as I try to work from the WebServer it doesn't anymore.
I get en error-message within the function "BeanMessage" >>Item in Collection
not found<<. After closing the Alert no more problems.
When building a try-Block into the function "BeanMessage" returning a Value
like "not-found" when try runs into an error, nothing will be found.
It looks like when using this on a WebServer the Object isn't populated yet ...
why?
Can anyone help me, why the Object isn't populated yet?
It seems to be populated after an Error-Message-Window.
Or, even better can tell me an easier way to do this ... and please I don't
want to create all Sites in different Languages, one change means changes in
several websites ...
Jay.