两个java脚本不能一起工作

Two javascripts not working together

本文关键字:一起 工作 不能 脚本 java 两个      更新时间:2023-09-26

我有一个网站,想在其中添加一些脚本。当我试图添加cant时,因为两个java脚本不能一起工作:

我的html代码

    <head>
        <link rel="stylesheet" type="text/css" href="http://2gdmedia.com/css/default.css" />
        <link rel="stylesheet" type="text/css" href="http://2gdmedia.com/css/component.css" />
        <script src="http://2gdmedia.com/js/modernizr.custom.js"></script>
                <link rel="stylesheet" href="http://en.2gdmedia.com/reveal.css">    
        <!-- Attach necessary scripts -->
        <!-- <script type="text/javascript" src="jquery-1.4.4.min.js"></script> -->
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
        <script type="text/javascript" src="http://en.2gdmedia.com/jquery.reveal.js"></script>
<script>$(document).ready(function() {
  // trigger reveal manually.
  $('#myModal').reveal({
     animation: 'fadeAndPop',                   //fade, fadeAndPop, none
     animationspeed: 300,                       //how fast animtions are
     closeonbackgroundclick: true,              //if you click background will modal close?
     dismissmodalclass: 'close-reveal-modal'    //the class of a button or element that will close an open modal
  });
});</script>
    </head>

只有当我删除这个:

        <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>

然后首先工作javascript:)请帮我,不要因为我最近被禁止而降低这个问题的评分。提前谢谢。如果需要提供任何详细信息,我随时准备发表评论:)

这可能是因为jquery冲突。如果是这种情况,请使用jquery的noConflict。或者将兼容版本的jquery添加到您的页面中。

如果不是这样,那么首先添加jquery,然后添加所有其他文件,然后查看。