2012-09-27 126 views
0

你好我使用jquery周历和PHP的日历,但如果把查询文件这样我收到冲突。jQuery的冲突

我header.phtml文件

代码

<head> 
<?php 
echo $this->headTitle('dddd'); 
$this->headMeta() 
     ->setHttpEquiv('Content-Type', 'text/html;charset=utf-8') 
     ->appendName('keywords', '') 
     ->appendName('author', '') 
     ->appendName('copyright', '') 
     ->appendName('description', ''); 
$this->headLink()->headLink(array('rel' => 'favicon', 'href' => '/favicon.ico'), 'PREPEND'); 
$this->headLink()     
      ->appendStylesheet($this->baseUrl.'/styles/layout.css', 'all') 
      ->appendStylesheet($this->baseUrl.'/scripts/jquery/jquery.css', 'all'); 

$this->headScript()->appendFile('http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js'); 
$this->headScript()->appendFile('http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js);   

$oFront = Zend_Controller_Front::getInstance(); 
if($oFront->getRouter()->getCurrentRouteName() == "template-schedules-edit-template-schedule"){ 
    $this->headScript()->appendFile($this->baseUrl.'/scripts/jquery/plugins/weekcalendar/jquery-ui.min.js'); 
}else{ 
    $this->headScript()->appendFile('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.19/jquery-ui.min.js'); 
}   

echo $this->headMeta(); 
echo $this->headLink(); 
echo $this->headScript(); 
?> 
</head> 

这里我使用jQuery/jQuery的周历和jQuery 1.3.2/jquery.min.js/1.7.2/jquery.js和对PHP canlender ..

请帮助我。它是我的第一个问题,就是堆栈溢出。

/uday

+0

为什么要使用2个版本的jQuery? –

+1

看一看['jQuery.noConflict()'](http://api.jquery.com/jQuery.noConflict/) – Bergi

+0

嗨BERGI,我该如何使用jQuery.noConflict()在这里.. – user1703428

回答

2

你不需要两个版本的jQuery。只要使用一个,你应该没问题。摆脱以下行:

$this->headScript()->appendFile('http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js); 
+0

喜SpaceBeers,如果我删除jquery/1.3.2/jquery.min.js这一拖放和调整大小不工作在周日历。 – user1703428

+0

如果您删除较新的版本,怎么办? – SpaceBeers

+0

腓压延一些其他文件不工作.. – user1703428

0

如果你正在创建新的代码,你应该避免使用2个版本的jQuery(使用最新的和适应所需)。如果由于某种原因或其他你不得不拥有两个(棘手的遗留代码),还有在具有2个版本的信息并存:Running Multiple versions of jQuery at the same time