Конфликты скриптов на сайте joomla
установил чистую joomla + virtuemart ну и парочку меню файлы js вообще не трогал но на сайте полезли ошибки.
Сайт на обновлении переезжаем с версии joomla 2,5 на 3. Вот допустим первая ошибка Uncaught ReferenceError: jQuery is not defined(anonymous function) @ (index):21 в файле index на 21 строке идет вывод скрипта меню jQuery Вот она jQuery('.hasTooltip').tooltip({"html": true,"container": "body"}); но меню без этого работать не будет. вот вообще не понятная Uncaught TypeError: e is not a function(anonymous function) @ bootstrap.min.js:8 (anonymous function) @ bootstrap.min.js:8 ведь этот файл bootstrap.min.js идет с чистой системой. да и в индексе он вроде как выключен //JHTML::_('behavior.framework', true); JHtml::_('jquery.framework'); // отключение скриптов в фронте $doc = JFactory::getDocument(); unset($doc->_scripts[JURI::root(true). '/media/jui/js/jquery.min.js']); unset($doc->_scripts[JURI::root(true). '/media/jui/js/jquery-noconflict.js']); unset($doc->_scripts[JURI::root(true). '/media/jui/js/bootstrap.min.js']); unset($doc->_scripts[JURI::root(true). '/media/jui/js/jquery-migrate.min.js']); помогите решить данную проблему так как в js не разбираюсь |
Stas1985,
сначала грузится jquery.min.js потом jquery-migrate.min.js потом все скрипты и плагины на jquery затем jquery-noconflict.js далее bootstrap.min.js и скрипты bootstrap |
закомментировал php с вызовом jquery и bootstrap
//JHTML::_('behavior.framework', true);
//JHtml::_('jquery.framework');
// отключение скриптов в фронте сираници
//$doc = JFactory::getDocument();
//unset($doc->_scripts[JURI::root(true). '/media/jui/js/jquery.min.js']);
//unset($doc->_scripts[JURI::root(true). '/media/jui/js/jquery-migrate.min.js']);
//unset($doc->_scripts[JURI::root(true). '/media/jui/js/jquery-noconflict.js']);
//unset($doc->_scripts[JURI::root(true). '/media/jui/js/bootstrap.min.js']);
Осталась одна ошибка Uncaught ReferenceError: mobilecheck is not defined(anonymous function) @ (index):34 вот скрипт который подгружает меню
jQuery(document).ready(function(){
jQuery('.hasTooltip').tooltip({"html": true,"container": "body"});
});
jQuery(document).ready(function()
{
jQuery('.hasPopover').popover({"html": true,"trigger": "hover focus","container": "body"});
});
window.setInterval(function(){var r;try{r=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}if(r){r.open("GET","/index.php?option=com_ajax&format=json",true);r.send(null)}},3600000);
if(mobilecheck()){
bindEvent(window,'load',function(){
juxTouchMenu('juxvm_mm_101');
});
};
34 строка тут }); |
Если перейти в товар то там 2 ошибки одна все та же и еще одна появилась связана с перелистыванием изображений.
Вот первая Uncaught ReferenceError: mobilecheck is not defined(anonymous function) @ izgotovlenie-prezentatsionnykh-albomov-2c-fotoalbomov-detail.html:75 Вот вторая Uncaught TypeError: jQuery(...).fancybox is not a function(anonymous function) @ izgotovlenie-prezentatsionnykh-albomov-2c-fotoalbomov-detail.html:48j @ jquery.min.js:2k.fireWith @ jquery.min.js:2m.extend.ready @ jquery.min.js:2J @ jquery.min.js:2 сам код с индекса
<script type="text/javascript">
jQuery(function($) {
SqueezeBox.initialize({});
SqueezeBox.assign($('a.modal').get(), {
parse: 'rel'
});
});
function jModalClose() {
SqueezeBox.close();
}
jQuery(document).ready(function() {
jQuery("a[rel=vm-additional-images]").fancybox({
"titlePosition" : "inside", /*! 48 строка тут */
"transitionIn" : "elastic",
"transitionOut" : "elastic"
});
jQuery(".additional-images a.product-image.image-0").removeAttr("rel");
jQuery(".additional-images img.product-image").click(function() {
jQuery(".additional-images a.product-image").attr("rel","vm-additional-images" );
jQuery(this).parent().children("a.product-image").removeAttr("rel");
var src = jQuery(this).parent().children("a.product-image").attr("href");
jQuery(".main-image img").attr("src",src);
jQuery(".main-image img").attr("alt",this.alt );
jQuery(".main-image a").attr("href",src );
jQuery(".main-image a").attr("title",this.alt );
jQuery(".main-image .vm-img-desc").html(this.alt);
});
});
jQuery(document).ready(function(){
jQuery('.hasTooltip').tooltip({"html": true,"container": "body"});
});
jQuery(document).ready(function()
{
jQuery('.hasPopover').popover({"html": true,"trigger": "hover focus","container": "body"});
});
window.setInterval(function(){var r;try{r=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}if(r){r.open("GET","/index.php?option=com_ajax&format=json",true);r.send(null)}},3600000);
if(mobilecheck()){
bindEvent(window,'load',function(){
juxTouchMenu('juxvm_mm_101');
});
};
/*! 75 строка тут */
</script>
Знатоки js помогите решить |
Проблема все еще актуальна.
Может есть способ как то скриптом нейтрализовать эти конфликты или хотя бы подпните как это решается |
<script type="text/javascript">jQuery.noConflict(); </script>
Так не прокатывает конфликты все ровно есть |
Пишет что fancybox не является функцией
Uncaught TypeError: jQuery(...).fancybox is not a function вот сам скрипт
$imageJS = '
jQuery(document).ready(function() {
jQuery("a[rel=vm-additional-images]").fancybox({
"titlePosition" : "inside",
"transitionIn" : "elastic",
"transitionOut" : "elastic"
});
jQuery(".additional-images a.product-image.image-0").removeAttr("rel");
jQuery(".additional-images img.product-image").click(function() {
jQuery(".additional-images a.product-image").attr("rel","vm-additional-images" );
jQuery(this).parent().children("a.product-image").removeAttr("rel");
var src = jQuery(this).parent().children("a.product-image").attr("href");
jQuery(".main-image img").attr("src",src);
jQuery(".main-image img").attr("alt",this.alt );
jQuery(".main-image a").attr("href",src );
jQuery(".main-image a").attr("title",this.alt );
jQuery(".main-image .vm-img-desc").html(this.alt);
});
});
';
вот что он выводит на сайте
jQuery(document).ready(function() {
jQuery("a[rel=vm-additional-images]").fancybox({
"titlePosition" : "inside",
"transitionIn" : "elastic",
"transitionOut" : "elastic"
});
этот скрипт отвечает за отображение картинок в карточке товара |
Цитата:
Joomla options Отключение Mootools Отключение Jquery Отключение Bootstrap |
Да я этот код вообще с индекса удалил
Осталось вот одна ошибка и она вроде как и мешает меняться картинкам |
Цитата:
|
| Часовой пояс GMT +3, время: 19:14. |