Javascript 为什么我的jquery没有';你不能在不同的领域工作吗?
我在两个不同的网站上有相同的代码,一个工作正常,另一个看起来好像没有jquery功能Javascript 为什么我的jquery没有';你不能在不同的领域工作吗?,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我在两个不同的网站上有相同的代码,一个工作正常,另一个看起来好像没有jquery功能 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>jQuery Countdown</title> <link rel="styleshe
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>jQuery Countdown</title>
<link rel="stylesheet" href=/build/timer/css/jquery.countdown.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="/build/timer/js/jquery.plugin.min.js"></script>
<script src="/build/timer/js/jquery.countdown.js"></script>
<script>
var j = jQuery.noConflict();
j(function () {
var austDay = new Date();
austDay = new Date(austDay.getFullYear() + 1, 1 - 1, 26);
j('#defaultCountdown').countdown({until: austDay});
j('#year').text(austDay.getFullYear()); });
</script>
<style>
#defaultCountdown {margin-left: -380px;width: 740px;height: 65px;}
#defaultCountdown span {font-size: 30px;font-family: Arial;}
body {background: #0f0017;}
</style>
</head>
<body>
<div id="defaultCountdown"></div>
</body>
</html>
jQuery倒计时
您发布的第二个链接是https,因此您还必须使用https加载脚本。还缺少样式表周围的开头引号
href=“/build/timer/css/jquery.countdown.css”>
导致此问题的原因可能是什么,它们上的代码是相同的
答案是:混合内容问题
当通过安全的HTTPS连接加载初始HTML,但通过不安全的HTTP连接加载其他资源(如图像、视频、样式表、脚本)时,会出现混合内容
。。。更多详细信息。在一个页面上,您使用的是无冲突的,这很好,但在另一个页面上,您尝试使用无冲突别名,这似乎不起作用