douzi9430 2016-09-07 18:41
浏览 186
已采纳

contenteditable不在Microsoft Edge上工作

I've got a dynamically created table, that utilizes "contenteditable".

Recently, I've had a user try to use the webpage via Microsoft Edge and none of the fields work. I then tried it on my computer as well, and had the same issue.

I use Google Chrome to develop and that works perfectly fine, and on the documentation it says that Edge is supported.

Here is the code that generates my tables rows:

while($row = $ret->fetchArray(SQLITE3_ASSOC) ){
    echo "<tr>";
        echo "<td style='width:10%;overflow:auto;border-left:1px solid #ddd;'>
            <div style='cursor:pointer' name='del' class='fa fa-times-circle fa-lg button2' aria-hidden='true'>
                <div style='display:none'>
                    ".$row['uniqueID']."
                </div>
            </div>
        </td>";
        echo "<td style='width:10%;overflow:auto;' id='Readable:".$row['uniqueID']."' contenteditable='true'>
            ".$row['Readable']."
        </td>";
        echo "<td style='width:10%;overflow:auto;' id='Type:".$row['uniqueID']."' contenteditable='true'>
            ".$row['Type']."
        </td>";
        echo "<td style='width:10%;overflow:auto;' id='Category:".$row['uniqueID']."' contenteditable='true'>
            ".$row['Category']."
        </td>";
        echo "<td style='width:10%;overflow:auto;' id='Status:".$row['uniqueID']."' contenteditable='true'>
            ".$row['Status']."
        </td>";
        echo "<td style='width:10%;overflow:auto;' id='ShelfID:".$row['uniqueID']."' contenteditable='true'>
            ".$row['ShelfID']."
        </td>";
        echo "<td style='width:10%;overflow:auto;' id='LocationID:".$row['uniqueID']."' contenteditable='true'>
            ".$row['LocationID']."
        </td>";
        echo "<td style='width:10%;overflow:auto;' id='Height:".$row['uniqueID']."' contenteditable='true'>
            ".$row['Height']."
        </td>";
        echo "<td style='width:10%;overflow:auto;' id='ListingStatus:".$row['uniqueID']."' contenteditable='true'>
            ".$row['ListingStatus']."
        </td>";
        echo "<td style='width:10%;overflow:auto;border-right:1px solid #ddd;' id='Sales:".$row['uniqueID']."' contenteditable='true'>
            ".$row['Sales']."
        </td>";
    echo "</tr>";
}

Is this some kind of incompatibility? What can I do to resolve this issue?

  • 写回答

1条回答 默认 最新

  • doudao7113 2016-09-07 21:34
    关注

    In order to avoid that kind of problems and maximize compatibility, it's better to use contentEditable only on a restricted number of tags like divs, if you use it in other elements like td then you might find problems like this one.

    So the solution would be to include a div in each of those cells and make those divs the contentEditable elements

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度