jquery - 我应该更改页面的 "behaviour"因为 IE 无法运行某些操作吗?

标签 jquery security internet-explorer ssl

让我澄清一下这个问题。我正在为特定事件创建一个简单的网页。客户端有一个没有 SSL 的域/主机。此页面包含有关该事件的信息和该事件的注册表,它使用 jQuery(用于验证)、PHP(用于发送电子邮件)和 Parse.com (用于将用户信息上传到数据库)。

该页面在 Chrome、Safari、Firefox、iOS 和 Android 上完美运行。但它在 IE 中不起作用(甚至在 IE 11 中也不行),除非安全选项允许一切(脚本等)。此外,(我在这里不太确定)Parse.com 函数在没有 SSL 的情况下无法在 IE 上运行。

我告诉客户,他说他无法获得 SSL 证书,他不介意告诉 IE 用户换个浏览器试试。

我的问题是:

  1. 考虑到所有背景和客户条件,这是一个好主意吗?
  2. 假设是这样,我在代码上考虑了这种方法:

HTML

<div id="ie-info">
    <p>Use a different browser...</p>
</div>

<div id="form">
    <p>Here comes the form</p>
</div>

Javascript

function isExplorer() {
    if(navigator.appName.indexOf("Explorer") > -1) {
        return true;
    }
    else if(navigator.appName == "MSIE") {
        return true;
    }
    else {
        return false;
    }
}

if (isExplorer()){ //Si usas Chrome poner "Netscape"
    document.getElementById("form").style.display = "none";
}
else {
    document.getElementById("ie-info").style.display = "none";
}

[这看起来很“基本”,因为我不希望 IE 在发现一些脚本时发疯]

在这种情况下,我改变我页面的行为 因为 IE,因为我现在页面上有两个 div,根据用户的浏览器,它会隐藏一些 div 或其他。我不知道这是否是一个好的方法,或者我可以做其他事情吗?

我没有太多经验,所以我想听听以前可能遇到过此类问题的人的意见。

最佳答案

我以前亲身遇到过这个问题,这里有一些指南可能会对您有所帮助。

  1. Check the percentage of users using Internet Explorer. If it's significant (e.g. > 50%), you might need to reconsider your strategy of letting them use a new browser. Otherwise your approach should be okay.
  2. Depending on your application and the data it handles, you might really need to get an SSL certificate. For most e-commerce sites, this is a minimum even if you're not using a third party like Parse.com which requires SSL.
  3. If you really need to support Internet Explorer, you have to convince your client to support SSL (if it's really required)

关于jquery - 我应该更改页面的 "behaviour"因为 IE 无法运行某些操作吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29562174/

相关文章:

javascript - 从 map 对象中删除中间对象

security - PicketLink - NoClassDefFound : org/picketlink/idm/config/StoreConfiguration

html - 如何防止在 IE 中选择文本?

html - 为什么正确的部分在 IE6 中的位置不同

internet-explorer - Internet Explorer 和 Firefox 上的 YouTube IFrame API

javascript - 如何在 jQuery 中获得正确的时间和顺序

javascript - jquery 查找包含选择器的异常

php - 如何使用jquery将数据发送到另一台服务器

security - Node.js Express 框架安全问题

java - Java插件和浏览器如何在内网验证applet的证书?