IE6-11使用location.href提交時的連結複製到firefox或chrome時出現亂碼

來源:互聯網
上載者:User

標籤:

這是在開發國際機票查詢頁時碰到的一個問題,測試工程師在IE裡執行查詢操作,然後把查詢的url賦值到firefox的地址欄,firefox開啟後就變成亂碼了。

1. IE瀏覽器,選擇出發地,出發日期等後點擊下查詢

 

2. 跳轉到查詢頁,賦值IE瀏覽器裡的URL

 

3. 拷貝到Firefox/Chrome瀏覽器地址欄,會發現出現了亂碼

 

對比看下IE和Firefox的URL情況發現是由於location.href方式在IE中沒有進行URI編碼,改成form提交後就好了。

IE6-11 

http://ijipiao.jd.com/international/query.action?_charset_=gbk&journeyType=RT&gjdepCity=北京&gjarrCity=香港&gjdepDate=2015-01-01&firstJourney.depCityName=北京&firstJourney.arrCityName=中文/拼音&firstJourney.depDate=&secondJourney.depCityName=中文/拼音&secondJourney.arrCityName=中文/拼音&secondJourney.depDate=&gjarrDate=2015-01-05&seatType=ECONOMY&passengerType=0&adtNum=1&chdNum=0&carrier=&carrierShow=不限&availableJourney=undefined&directOnly=false

 

Firefox/Chrome

http://ijipiao.jd.com/international/query.action?_charset_=gbk&journeyType=RT&gjdepCity=%B1%B1%BE%A9&gjarrCity=%CF%E3%B8%DB&gjdepDate=2015-01-02&firstJourney.depCityName=%B1%B1%BE%A9&firstJourney.arrCityName=%D6%D0%CE%C4/%C6%B4%D2%F4&firstJourney.depDate=&secondJourney.depCityName=%D6%D0%CE%C4/%C6%B4%D2%F4&secondJourney.arrCityName=%D6%D0%CE%C4/%C6%B4%D2%F4&secondJourney.depDate=&gjarrDate=2015-01-07&seatType=ECONOMY&passengerType=0&adtNum=1&chdNum=0&carrier=&carrierShow=%B2%BB%CF%DE&availableJourney=undefined&directOnly=false

IE6-11使用location.href提交時的連結複製到firefox或chrome時出現亂碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.