让我澄清一下这个问题。我正在为特定事件创建一个简单的网页。客户端有一个没有 SSL 的域/主机。此页面包含有关该事件的信息和该事件的注册表,它使用 jQuery
(用于验证)、PHP
(用于发送电子邮件)和 Parse.com
(用于将用户信息上传到数据库)。
该页面在 Chrome、Safari、Firefox、iOS 和 Android 上完美运行。但它在 IE 中不起作用(甚至在 IE 11 中也不行),除非安全选项允许一切(脚本等)。此外,(我在这里不太确定)Parse.com
函数在没有 SSL 的情况下无法在 IE 上运行。
我告诉客户,他说他无法获得 SSL 证书,他不介意告诉 IE 用户换个浏览器试试。
我的问题是:
- 考虑到所有背景和客户条件,这是一个好主意吗?
- 假设是这样,我在代码上考虑了这种方法:
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
或其他。我不知道这是否是一个好的方法,或者我可以做其他事情吗?
我没有太多经验,所以我想听听以前可能遇到过此类问题的人的意见。
最佳答案
我以前亲身遇到过这个问题,这里有一些指南可能会对您有所帮助。
- 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.
- 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.
- 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/