Cookie

因製作活動頁有使用到cookie去紀錄票選選項時遇到IOS的cookie無法紀錄中文字串,以下為兩種解法

1.利用escape()先轉碼,之後再使用switch做解碼的動作並且發送

http://www.hehaibao.com/ios-safari-cookie/

2.將valus值取為英文,之後進行轉換成中文發送

    var voteName = document.cookie.split('MeetCheckRadio=')[1].split(';')[0]
    switch(voteName.toString()){
            case voteName = 'vote1':
                voteName = '展覽活動查詢'
                break
            case voteName = 'vote2':
                voteName = '會議活動查詢'       
                break
            case voteName = 'vote3':
                voteName = '展覽場地租借'
                break
            case voteName = 'vote4':
                voteName = '國內外參訪活動'
                break
            case voteName = 'vote5':
                voteName = '產業的研究報告'
                break
            case voteName = 'vote6':
                voteName = '會展商機媒合'
                break
            case voteName = 'vote7':
                voteName = '會展融資創投'
                break
            case voteName = 'vote8':
                voteName = '會展輔導補助'
                break
            case voteName = 'vote9':
                voteName = '網站及APP建置'
                break
            case voteName = 'vote10':
                voteName = '人才培訓與認證'
                break
            default:
                break
        }

results matching ""

    No results matching ""