I'm trying to change the language using radio buttons but it is not working. Here is the code which I have tried
settings.jsp:
<div>
<s:iterator value="languages">
<span class="languages"> <s:radio list="#{Value:Name }"
id="language" name="request_locale"
onclick="changeLanguage(this.value)" value="%{language}" />
</span>
</s:iterator>
</div>
script:
function changeLanguage(locale) {
// alert(locale);
$.ajax({
async: false,
url: '../login/userProfile_changeLanguage.action?language='+locale,
success: function(data, status, xhr) {
if(xhr.getResponseHeader('sessionStatus') == 701){
window.location.href = window.location.pathname.substring(0,window.location.pathname.substring(1).indexOf("/")+1);
}
else{
$('#main').html(data);
}
}
});
}
where I went wrong?
Aucun commentaire:
Enregistrer un commentaire