<script language="javascript"> //換語系不換頁
function changeasp(language) {
var LSA = location.pathname;
//取出陣列的最後一項即為目前檔名
var gurl=split(LSA,'_');
var CFN=LSA.replace(gurl[0],language);
//if (language == "tw") {
// var CFN = LSA.replace(/eng_/, "tw_")
//}
//else {
// var CFN = LSA.replace(/tw_/, "eng_")
//}
location.href = CFN;
}
</script>
<li><a href="javascript:changeasp('tw');">中文繁體</a></li>
<li><a href="javascript:changeasp('eng');">English</a></li>
以上為簡易的網站語系切換
沒有留言:
張貼留言