Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/378.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法加载2个jquery脚本_Javascript_Jquery_Html - Fatal编程技术网

Javascript 无法加载2个jquery脚本

Javascript 无法加载2个jquery脚本,javascript,jquery,html,Javascript,Jquery,Html,我有javascript,可以从数据库加载网站上的新帖子,之前: <script type="text/javascript"> function LoadContent() { patch = window.location.toString(); if (patch!== undefined && patch=="http://i-sc.ru/" || patch=="http://i-sc.ru/index.php") {

我有javascript,可以从数据库加载网站上的新帖子,之前:

  <script type="text/javascript">
 function LoadContent() {
        patch = window.location.toString();
       if (patch!== undefined && patch=="http://i-sc.ru/" || patch=="http://i-sc.ru/index.php") {
        $.ajax({
        url: patch,
        success: function(content) {
    $('#dle-content').html($('#dle-content', content).html());
    }})}

    setTimeout("LoadContent()", 50);
    }

    </script>

      <script type="text/javascript">
      $(document).ready(function(){
LoadContent()

});
      </script>

函数LoadContent(){
patch=window.location.toString();
如果(补丁!==未定义&&patch==”http://i-sc.ru/“| |补丁==”http://i-sc.ru/index.php") {
$.ajax({
url:patch,
成功:功能(内容){
$('#dle content').html($('#dle content',content.html());
}})}
setTimeout(“LoadContent()”,50);
}
$(文档).ready(函数(){
LoadContent()
});
在我设置好脚本之后

<script type="text/javascript" src="js/jquery.fancyzoom.js"></script>

我放在

设立:

    <script type="text/javascript">
$(function() {
  //Set the default directory to find the images needed
  //by the plugin (closebtn.png, blank.gif, loading images ....)
  $.fn.fancyzoom.defaultsOptions.imgDir='../images/'; //very important must finish with a /

  $('a.tozoom').fancyzoom({Speed:0});

  $('a').fancyzoom({overlay:0.6});

  //new rev > 1.2
  //apply fancyzoom effect on all image whose class is fancyzoom !!

  $('img.fancyzoom').fancyzoom();
});
</script>

$(函数(){
//设置默认目录以查找所需的图像
//通过插件(closebtn.png、blank.gif、加载图像…)
$.fn.fancyzoom.defaultsOptions.imgDir='../images//';//非常重要的一点必须以/
$('a.tozoom').fancyzoom({Speed:0});
$('a').fancyzoom({overlay:0.6});
//新版本>1.2
//对其类为fancyzoom的所有图像应用fancyzoom效果!!
$('img.fancyzoom').fancyzoom();
});
那么现在关于这个问题:

当网站加载时,我想我不能缩放图像,因为冲突


如何解决它?

不要多次引用
jquery.js
文件,从第二个脚本中删除对该文件的引用


并确保脚本中的任何位置都没有引用
不同版本的
.js
文件

您应该从
js/jquery.fancyzoom.js
中删除
标记,看看这是否有效。大多数情况下,发生这种情况是因为同一个js被多次加载。请确保情况并非如此。