R
Rob
I'm developing a proof-reading page for a multi-language site. On my
proofing page, I would like the proof-reader to be able to click a "language
link" at the top of the page; forcing a page reload with paragraphs written
in the chosen language.
I've created a series of document.write statements which insert a variable
called "lango", thereby changing the pathname for the documents to be
written out, to a particular langague name; Example >>
document.write('<scr'+'ipt language="Javascript"
type="text/javascript"
src="languages/'+lango+'/paragraph1.js"></scr'+'ipt>');
I have a numbered series of about 20 or so paragraphs for proofing
(paragraph1.js, paragraph2.js.... etc). My script which currently assigns
the "lango" variable for these statements - which seems oddly enough to only
work when placed in the <body>, not the <head> of the document, is this:
<script language="JavaScript">
<!--
var lango = "en";
// -->
</script>
What I would like to do is write a function, whereby when a proofreader
clicks on a language link on the top of the page, it will re-assign the
variable "lango" to a string representing his chosen language and force a
page refresh with the new variable in force (or is that not possible without
cookies?)
So, a visitor clicks the french link at the top of the page.
The link looks like this: <a href="#" onClick="LangClick(fr)">FRENCH
VERSION</a>
The LangClick function looks something like this (forgive me if i'm way
off!)
<script language="JavaScript">
<!--
var lango = "en";
function LangClick(clicko)
{ var lango = var clicko;
document.location.reload();
}
// -->
</script>
I'm attempting to pass the argument " fr " to the function LangClick, in the
form of variable "clicko", which will then be assigned to variable "lango".
(I've used "lango" because "lang" is a reserved attrib for html tags)
thanks for any help with this; i don't normally use much JS in my pages,
just begining to experiment with it.
Rob
proofing page, I would like the proof-reader to be able to click a "language
link" at the top of the page; forcing a page reload with paragraphs written
in the chosen language.
I've created a series of document.write statements which insert a variable
called "lango", thereby changing the pathname for the documents to be
written out, to a particular langague name; Example >>
document.write('<scr'+'ipt language="Javascript"
type="text/javascript"
src="languages/'+lango+'/paragraph1.js"></scr'+'ipt>');
I have a numbered series of about 20 or so paragraphs for proofing
(paragraph1.js, paragraph2.js.... etc). My script which currently assigns
the "lango" variable for these statements - which seems oddly enough to only
work when placed in the <body>, not the <head> of the document, is this:
<script language="JavaScript">
<!--
var lango = "en";
// -->
</script>
What I would like to do is write a function, whereby when a proofreader
clicks on a language link on the top of the page, it will re-assign the
variable "lango" to a string representing his chosen language and force a
page refresh with the new variable in force (or is that not possible without
cookies?)
So, a visitor clicks the french link at the top of the page.
The link looks like this: <a href="#" onClick="LangClick(fr)">FRENCH
VERSION</a>
The LangClick function looks something like this (forgive me if i'm way
off!)
<script language="JavaScript">
<!--
var lango = "en";
function LangClick(clicko)
{ var lango = var clicko;
document.location.reload();
}
// -->
</script>
I'm attempting to pass the argument " fr " to the function LangClick, in the
form of variable "clicko", which will then be assigned to variable "lango".
(I've used "lango" because "lang" is a reserved attrib for html tags)
thanks for any help with this; i don't normally use much JS in my pages,
just begining to experiment with it.
Rob