我刚刚编写了一个简单的注册页面,并使用纯 javascript 和 jquery 对其进行了验证。我还使用font-awesome图标来显示输入值的状态。它与所有用户代理都运行良好(我使用 Chrome 扩展对其进行了测试)。但将文件放入服务器后,它无法与任何用户代理一起使用。
issues :
Some user agents not showing font awesome icons, but the scripts are working.
In some user agents the icons as well as the scripts both are not working.
我不知道问题出在哪里。
<head>
<title>TicketIsle Login</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="validation.js"></script>
<script type="text/javascript" src="js/get_post.js"></script>
</head>
以上是我放置脚本和样式文件的方式。
最佳答案
如果您的页面是安全 (https) 页面,则某些浏览器不允许您明确从非安全 (http) 页面下载脚本或样式。
应使用此语法来避免此协议(protocol)问题:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
这是与协议(protocol)无关的,即它可以与 http
一起使用。和https
.
关于Javascript、Jquery 在本地主机中工作正常,但在部署的站点中却不行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38366865/