不包含时间脚本不工作
not contains time script not working
这是我的代码:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
<span class='whocares'><div class='box'><span style='font-size:20px;color: #0BB;'>12/26/2012 is the best</span></div><br></span><span class='whocares'><div class='box'><span style='font-size:20px;color: #0BB;'>12-26-2012</span></div><br></span><span class='whocares'><div class='box'><span style='font-size:20px;color: #0BB;'>messa coockcook</span></div><br></span><script>
$(document).ready(function() {
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
$(".whocares:not(:contains('" + month + "/" + day + "/"+ year+"'))").remove();
});
</script>
它可以在JSFiddle上工作,但不能在我的服务器上。在我的服务器上,当我运行它时,什么也没有出现。为什么会这样呢?我做错了什么?
提前感谢!
首先,查看您的源代码:
<b>Warning</b>: file_get_contents(http://www.dumbsearch.com/reminded.txt) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in <b>/home/content/76/7290476/html/remindersimportant.php</b> on line <b>4</b><br />
其次,你需要考虑不同时区的人。例如,我在IST时区,所以现在已经是2012年12月27日了。
除此之外,你的HTML格式不合理。
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
这里需要一个闭合的</script>
。这就是为什么你不能在服务器上看到你的错误的原因之一。
它总是有助于保持良好的缩进代码。很容易在关键的地方发现这些错误。
你的jQuery脚本标签没有正确关闭
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<span class='whocares'><div class='box'><span style='font-size:20px;color: #0BB;'>12/26/2012 is the best</span></div><br></span><span class='whocares'><div class='box'><span style='font-size:20px;color: #0BB;'>12-26-2012</span></div><br></span><span class='whocares'><div class='box'><span style='font-size:20px;color: #0BB;'>messa coockcook</span></div><br></span>
<script>
$(document).ready(function() {
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
$(".whocares:not(:contains('" + month + "/" + day + "/"+ year+"'))").remove();
});
</script>
相关文章:
- HTML标记在脚本标记中工作
- 使用谷歌应用程序脚本从工作表中获取值并将其显示在文本框中
- 密码输入键脚本在首次使用后无法工作
- prettyPhoto脚本是't工作
- 在pjax完成其工作时加载脚本
- $(document).ready和jQuery(function($)不工作;jQuery已定义,但脚本尚未定义;t进
- 使用几个<脚本>标签不会't工作-只调用一个脚本
- 重新启动jquery脚本后,角度停止工作
- 我的时间倒计时脚本在谷歌浏览器中工作正常,但在其他浏览器中打开时它显示为南楠
- 当源工作表添加了行时,如何编写在一个工作表中添加行的脚本
- Cufon脚本没有'不能在IE9下工作
- java脚本点击事件处理程序不工作
- 更改谷歌工作表中ImportHTML值的脚本
- 为什么这个书签脚本是't在IE工作
- Javascript函数不工作.脚本定位问题
- 谷歌SWIFFY无法在IE9中工作-脚本错误'运行时.js'
- 从控制台中的工作函数转换为工作脚本.(请参阅编辑)
- jQuery最新的库不工作脚本
- window.close()没有't工作-脚本可能只关闭它打开的窗口
- 链接到外部js文件不工作<脚本src="client.js"