【问题标题】:jQuery not working on homepage [closed]jQuery在主页上不起作用[关闭]
【发布时间】:2012-08-27 20:54:42
【问题描述】:

这真的很奇怪。如果我访问我的网站 www.example.com,jQuery 将无法在我的索引文件/主页上运行。但是,如果我输入 www.example.com/index.html jQuery 加载就好了。任何想法发生了什么或如何解决这个问题?

http://www.japaneselanguagefriend.com

http://www.japaneselanguagefriend.com/index.html

【问题讨论】:

  • 您拥有www.example.com?惊人的!那里没有 jQuery 代码!我们都不知道您的主页是如何获取脚本的! :P
  • 在任一页面点击查看源代码有区别吗?
  • 您是否有另一个名为 index 的文件,例如 index.php,可能没有您更新的代码?
  • 是的,正如@smartcaveman 和 Glenn 所说,可能有两个文件?

标签: javascript jquery html


【解决方案1】:

您在包含之前尝试使用 jQuery:

  <script>$(document).ready(function() {
    $("a.register").fancybox({
        'type': 'iframe'
    });
});
</script>
<script src="http://code.jquery.com/jquery-1.8.1.min.js"></script>

确保这是第一个:

<script src="http://code.jquery.com/jquery-1.8.1.min.js"></script>

【讨论】:

  • 非常感谢。我会记住,它需要先运行,否则将无法正确加载。非常感谢您的帮助!
【解决方案2】:

http://www.japaneselanguagefriend.com/

某些标签不存在,例如:&lt;body&gt; 标签

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
  <title>Japanese Language Friend - An Artistic Approach to Learning Japanese! </title>
  <META name="description" content="Learn Japanese by stimulating artwork! Join our community and lay down the first stepping stone to improving your Japanese language skills"><META name="keywords" content="Japanese art, Japanese, Japan, Learning Japanese, learning japanese, study japanese, fluent japanese,  japanese language friend, help with japanese, amazon japanese language, second language, japanese language community, japanese language friends, japanese language friend">
</head>
<frameset rows="100%,*" border="0">
  <frame src="http://japanesefriend.zxq.net" frameborder="0" />
  <frame frameborder="0" noresize />
</frameset>

<!-- pageok -->
<!-- 07 -->
<!-- -->
</html>

【讨论】:

  • 非常感谢您的帮助!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-04-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-01-30
  • 1970-01-01
相关资源
最近更新 更多