Change language with onclick-event?
Hallo everybody. Mein name is Cristiano and I've got a problem.
I'm trying to change the language of my Homepage when I click on an small flag on the right corner. Something that everyone has already seen in the Internet. Very simple.
To hold the language I created a session variable, that should change his value, when I click on the picture.
I have written the following function, that functions perfectly.
<cffunction name="changeLanguage">
<cfargument name="language" type="string">
<cfset session.userLanguage = language>
<cfreturn session.userLanguage>
</cffunction>
But my problem is when I click on the image nothing happens.
<img src="images/de.gif" width="19" height="15" onclick="changeLanguage('DE')"/>
<img src="images/fr.gif" width="19" height="15" onclick="changeLanguage('FR')"/>
DE = german
FR = france
What is wrong with my code? Can I do that with onclick or there is a better way?
It's possible to mix JavaScript and ColdFusion without a problem?
Thank you for your help
Cristiano
