dtkmejg127475 2019-06-17 09:10
浏览 79

URL中的字段名称在Internet Explorer上替换为“×”

I'm using the jQuery serialize() and window.open function to get the forms data to another page that will print out a file based on the data.

Before the redirect the URL looks OK (console logged the serialized URL):

renter_postal_address%5D=&times%5Bstart_date%5D=17.06.2019&times%5Bstart_hours%5D=10&times%5Bstart_minutes%5D=56&times%5Bend_date%5D=17.06.2019&times%5Bend_hours%5D=11&times%5Bend_minutes%5D=56

After I reach the desired page the URL looks like this (only on I.E):

renter_postal_address%5D=×%5Bstart_date%5D=17.06.2019×%5Bstart_hours%5D=10×%5Bstart_minutes%5D=56×%5Bend_date%5D=17.06.2019×%5Bend_hours%5D=11×%5Bend_minutes%5D=56

URL on Google Chrome:

?act=rent.fillBookingContractTemplate&item_id=1&data=action=issue_item&item_id=&data%5Bcontract_no%5D=1560762473&data%5Bcurrent_unit_id%5D=&data%5Brenter_personal_code%5D=&data%5Brenter_name%5D=&data%5Brenter_phone%5D=&data%5Brenter_email%5D=&data%5Brenter_postal_address%5D=&times%5Bstart_date%5D=17.06.2019&times%5Bstart_hours%5D=12&times%5Bstart_minutes%5D=07&times%5Bend_date%5D=17.06.2019&times%5Bend_hours%5D=13&times%5Bend_minutes%5D=07&data%5Breturned_to_unit_id%5D=0&data%5Bcountry%5D=Eesti&data%5Breceived_helmets%5D=&data%5Bdocument_id%5D=&data%5Bdocument_issue_date%5D=&data%5Bdocument_valid_to%5D=&data%5Blicence_id%5D=&data%5Blicence_issue_date%5D=&data%5Blicence_valid_to%5D=&data%5Bissuing_comment%5D=

URL on Internet Explorer (latest version):

?act=rent.fillBookingContractTemplate&item_id=1&data=action=issue_item&item_id=&data%5Bcontract_no%5D=1560762453&data%5Bcurrent_unit_id%5D=&data%5Brenter_personal_code%5D=&data%5Brenter_name%5D=&data%5Brenter_phone%5D=&data%5Brenter_email%5D=&data%5Brenter_postal_address%5D=×%5Bstart_date%5D=17.06.2019×%5Bstart_hours%5D=12×%5Bstart_minutes%5D=07×%5Bend_date%5D=17.06.2019×%5Bend_hours%5D=13×%5Bend_minutes%5D=07&data%5Breturned_to_unit_id%5D=0&data%5Bcountry%5D=Eesti&data%5Breceived_helmets%5D=&data%5Bdocument_id%5D=&data%5Bdocument_issue_date%5D=&data%5Bdocument_valid_to%5D=&data%5Blicence_id%5D=&data%5Blicence_issue_date%5D=&data%5Blicence_valid_to%5D=&data%5Bissuing_comment%5D=

Code example that reproduces the error:

<?php
if (isset($_GET)) {
    var_dump($_GET);
}
?>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" crossorigin="anonymous"
        integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="></script>

<form method="POST" id="item-issuing-form">
    <input type="hidden" name="action" value="issue_item">
    <input type="hidden" name="item_id" value="275">
    <input type="hidden" name="data[contract_no]" value="1560836285">
    <input type="hidden" name="data[current_unit_id]" value="664">

    <input name="data[renter_personal_code]">
    <input name="data[renter_name]">
    <input name="data[renter_phone]">
    <input name="data[renter_email]">
    <input name="data[renter_postal_address]">
    <input name="times[start_date]">
    <select name="times[start_hours]"></select>
    <select name="times[start_minutes]"></select>
    <input name="times[end_date]">
    <select name="times[end_hours]"></select>
    <select name="times[end_minutes]"></select>
    <select name="data[returned_to_unit_id]"></select>
    <select name="data[country]"></select>
    <input name="data[received_helmets]">
    <input name="data[document_id]">
    <input name="data[document_issue_date]">
    <input name="data[document_valid_to]">
    <input name="data[licence_id]">
    <input name="data[licence_issue_date]">
    <input name="data[licence_valid_to]">
    <textarea name="data[issuing_comment]"></textarea>

    <button type="button" class="go-test">Go</button>
</form>

<script>
    $('.go-test').on('click', function () {
        window.open('index.php?item_id=275&data=' + $('#item-issuing-form').serialize(), '_blank');
    });
</script>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 安装svn网络有问题怎么办
    • ¥15 Python爬取指定微博话题下的内容,保存为txt
    • ¥15 vue2登录调用后端接口如何实现
    • ¥65 永磁型步进电机PID算法
    • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥15 latex怎么处理论文引理引用参考文献