Using Javascript to display different language acceptance templates
M
Michelle Moore
started a topic
over 6 years ago
Is anyone here able to offer some javascript assistance?
I need to be able to show different variations of the Acceptance template to cater for customers whose first language is not English.
I figure this may be possible by using javascript to query the language set on the browser being used to view the page and to show/hide a particular div within the page based on this.
Looking at code snippets online, I think this is a good place to start but I've not been able to get it to work as yet:
<script type="text/javascript">
var userLang = navigator.language || navigator.userLanguage;
if (userLang == "de") {
$("#deutsch").show();
} else {
$("#english").show();
}
</script>
Michelle Moore
Is anyone here able to offer some javascript assistance?
I need to be able to show different variations of the Acceptance template to cater for customers whose first language is not English.
I figure this may be possible by using javascript to query the language set on the browser being used to view the page and to show/hide a particular div within the page based on this.
Looking at code snippets online, I think this is a good place to start but I've not been able to get it to work as yet:
Any help appreciated!