Title: отвалился jquery
Last modified: 02.02.2015

---

# отвалился jquery

 *  [zlodiak](https://ru.wordpress.org/support/users/zlodiak/)
 * (@zlodiak)
 * [11 лет, 8 месяцев назад](https://ru.wordpress.org/support/topic/%d0%be%d1%82%d0%b2%d0%b0%d0%bb%d0%b8%d0%bb%d1%81%d1%8f-jquery/)
 * у меня довольно бредовый вопрос, но всё таки надеюсь хоть на какой-то совет
 * был сайт на вордпресс, он работал без проблем. после обновления перестало работать
   всё, что связано с jquey. консоль выводит следующее:
 *     ```
       Consider using 'dppx' units, as in CSS 'dpi' means dots-per-CSS-inch, not dots-per-physical-inch, so does not correspond to the actual 'dpi' of a screen. In media query expression: (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)
       jquery.fancybox.js?ver=1.3.4:18 Uncaught TypeError: Cannot read property 'msie' of undefined
       jquery.mobile.customized.min.js:1 Uncaught TypeError: Cannot set property 'touchstart' of undefined
       custom-script.js?ver=1.0:1 1234
       custom-script.js?ver=1.0:4 Uncaught TypeError: undefined is not a function
       custom.js?ver=1.0:84 Uncaught TypeError: Cannot read property 'msie' of undefined
       ```
   
 * вот один из js-файлов с расставленными в целях отладки консолелогами():
 *     ```
       console.log(1234);
   
       (function($) {
           $(function(){
           	console.log(555);
           	//Dropdown cart in header
       		$('.cart-holder > h3').click(function(){
       			if($(this).hasClass('cart-opened')) {
       				$(this).removeClass('cart-opened').next().slideUp(300);
       			} else {
       				$(this).addClass('cart-opened').next().slideDown(300);
       			}
       		});
       		//Popup rating content
       		$('.star-rating').each(function(){
       			rate_cont = $(this).attr('title');
       			$(this).append('<b class="rate_content">' + rate_cont + '</b>');
       		});
   
       	    /* hide second menu */
       	    $('header .select-menu').eq(1).css({
       	    	'display': 'none',
       	    });
   
       	    /* cut second menu */
       	    var	coll = $('header .select-menu').eq(0).find('option');
       	    var length = coll.length;
       	    var	lengthDiv = Math.round(length / 2) - 1;
   
       	    $('header .select-menu').eq(0).find('option:gt(' + lengthDiv + ')').css({
       	    	'display': 'none',
       	    });
   
           });
   
       	// add wrap cont for catalog stones
       	$('body #motopress-main.main-holder .content-holder ul.products .product > a:first-child img').wrap('<div class="sk_catalog_item"></div>');
   
       	// add wrap cont for sidebar right widget
       	$('.product_list_widget > li > a > img').wrap('<div class="sk_catalog_item_sidebar"></div>');
   
       })(jQuery);
   
       console.log(666666);
   
       $( document ).ready(function() {
       	// add wrap for cart widget
       	setTimeout(function(){
       		$('#shopping_cart-3 .cart_list li a > img').wrap('<div class="sk_catalog_item_cart"></div>');
       	}, 2000);
   
       	// cart mark full trigger
       	cart_observer();
   
       	function cart_observer(){
       		setTimeout(function(){
       			//var	mark = $('body').is('.empty');
   
       			if($(".empty").length>0) {
       				$('#shopping_cart-3 > .mark_cart').remove();
       			}else{
       				$('#shopping_cart-3 > h3').prepend('<span class="mark_cart">*</span>');
       			};
       		}, 2000);
       	};
   
       	// in cart-page change label for checkout-button
       	$('#content .shop_table.cart .checkout-button').val('Оформить заказ');
   
       	setTimeout(function(){
       		$('#shopping_cart-3 .buttons .checkout').text('Оформить заказ →');
       	}, 2000);
   
       	//search and make contentwidth 46%
       	$('#form_zakaz_outer_top').next().css({
       		'width': '70%'
       	});
   
       	$('#form_zakaz_outer_top').closest('.entry-content').find('table').eq(0).css({
       		'width': '70%'
       	});	
   
       	$('#form_zakaz_outer_top').closest('.entry-content').find('table').eq(1).css({
       		'width': '70%'
       	});	
   
       	// bottom place for zakaz form
       	var	contentCollection = $('section#form_zakaz_outer_top').nextUntil('section#form_zakaz_outer_bottom').get().reverse();
       	var	height = 0,
       		minusHeight = 0;
   
           $(contentCollection).each(function(){
           	height += $(this).outerHeight();
   
           	if(height <= 530){
           		$(this).css({
           			'width': '70%'
           		}).attr('style', 'width:70%');
           		minusHeight += height
           	}
           	else{
           		return false;
           	};
           });
   
       /*    console.log('======');
           console.log(window.location.pathname);*/
           if(window.location.pathname == '/portfolio-view/dekorativnye-elementy/'){
           	$('#form_zakaz_outer_bottom').hide();
           }
   
       /*	$('#form_zakaz_outer_bottom').css({
       		'margin-top': '-600px'
       	}); */   
   
       	// filler data for form_zakaz_outer_top
       	var	title_zakaz = $('#form_zakaz_outer_top .title_zakaz');
       	var	link_zakaz = $('#form_zakaz_outer_top .link_zakaz');
   
       	if(title_zakaz.length > 0){
       		title_zakaz.val($.trim($('.motopress-wrapper .title-section .title-header').text()));
       	};
   
       	if(link_zakaz.length > 0){
       		link_zakaz.val(location.href);
       	};  
   
       	// filler data for form_zakaz_outer_bottom
       	var	title_zakaz = $('#form_zakaz_outer_bottom .title_zakaz');
       	var	link_zakaz = $('#form_zakaz_outer_bottom .link_zakaz');
   
       	if(title_zakaz.length > 0){
       		title_zakaz.val($.trim($('.motopress-wrapper .title-section .title-header').text()));
       	};
   
       	if(link_zakaz.length > 0){
       		link_zakaz.val(location.href);
       	};
       });
   
       $( window ).load(function() {
   
       });
   
       // hide бусплатно on sidebar
       document.querySelector('.product_list_widget .star-rating')
       var x = document.querySelectorAll('.star-rating');
       //console.log(x + '====');
       for(var i in x){
       	//if(x[i]){
           	x[i].parentNode.removeChild( x[i].nextSibling );
       	//}
   
       }
       ```
   
 * теоретически я понимаю, что проблема в обастях видимости. но сам не могу понять
   в чём ошибка, а главное почему после обновления по всем правилам документации
   случилась такая ситуация

 Тема «отвалился jquery» закрыта для новых ответов.

## Метки

 * [jQuery](https://ru.wordpress.org/support/topic-tag/jquery/)

 * Форум: [Проблемы и решения](https://ru.wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 ответов
 * 1 участник
 * Последний ответ: [zlodiak](https://ru.wordpress.org/support/users/zlodiak/)
 * Последняя активность: [11 лет, 8 месяцев назад](https://ru.wordpress.org/support/topic/%d0%be%d1%82%d0%b2%d0%b0%d0%bb%d0%b8%d0%bb%d1%81%d1%8f-jquery/)
 * Статус: нерешённая

## Темы

### Самые популярные темы

### Темы без ответов

### Без вопроса

### Решённые

### Нерешённые

### Все темы
