Error syntax error unrecognized expression nth child

Syntax error, unrecognized expression: :nth-child in firefox about textillate HOT 3 OPEN Comments (3) Reproduced in Chrome also. And gripgrip’s code doesn’t help 🙁 e-oz commented on January 15, 2023 «awesome» plugin, lol. Wash your code. e-oz commented on January 15, 2023 Related Issues (20) textillate.js is not working HOT 3 No animations at […]

Содержание

  1. Syntax error, unrecognized expression: :nth-child in firefox about textillate HOT 3 OPEN
  2. Comments (3)
  3. Related Issues (20)
  4. Recommend Projects
  5. React
  6. Vue.js
  7. Typescript
  8. TensorFlow
  9. Django
  10. Laravel
  11. Recommend Topics
  12. javascript
  13. server
  14. Machine learning
  15. Visualization
  16. Recommend Org
  17. Facebook
  18. Microsoft
  19. Syntax error unclear #326
  20. Comments

Syntax error, unrecognized expression: :nth-child in firefox about textillate HOT 3 OPEN

Reproduced in Chrome also. And gripgrip’s code doesn’t help 🙁

e-oz commented on January 15, 2023

«awesome» plugin, lol. Wash your code.

e-oz commented on January 15, 2023

  • textillate.js is not working HOT 3
  • No animations at all from textillate HOT 1
  • Its not issue its question) HOT 5
  • loop change
  • Each word is cut off at the beginning and end on safari HOT 4
  • RTL (Right To Left) languages problem HOT 1
  • No out animation HOT 1
  • Bug: iterating through a list selector, delay on the beginning of the animation
  • maxDisplayTime
  • custom css problems? HOT 1
  • hide generated span before restart ( stop /start )
  • Callback: how to use?
  • jQuery.Deferred exception: $(. ).textillate is not a function HOT 1
  • end.tlt — не работает
  • Control animation by buttons
  • Textillate @types for typescript
  • InitialDelay Option not working
  • text changing on centered sentence
  • . -3,2,100415336339668675477//9*++-+
  • It can not work with animate.css v4.1.1 HOT 3

Recommend Projects

React

A declarative, efficient, and flexible JavaScript library for building user interfaces.

Vue.js

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Typescript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

TensorFlow

An Open Source Machine Learning Framework for Everyone

Django

The Web framework for perfectionists with deadlines.

Laravel

A PHP framework for web artisans

Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

javascript

JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

Some thing interesting about web. New door for the world.

server

A server is a program made to process requests and deliver data to clients.

Machine learning

Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

Visualization

Some thing interesting about visualization, use data art

Some thing interesting about game, make everyone happy.

Recommend Org

Facebook

We are working to build community through open source technology. NB: members must have two-factor auth.

Microsoft

Open source projects and samples from Microsoft.

Источник

Syntax error unclear #326

We ran some front-end tests and saw the error:

We dug for a while looking for a stray # in our code before searching the internet deep enough to realize this was an invalid jQuery selector.

This error message would be more clear if it mentioned «sizzle», «jQuery», «selector», or another string that would make it clear to the user that this is not a JavaScript syntax error, but a sizzle selector expression syntax error.

The text was updated successfully, but these errors were encountered:

@timmywil @dmethvin Do either of you foresee harm in changing the message (e.g., losing search results)? I would like to be more clear and concise, and seem to remember an existing ticket in jQuery that I can’t find right now.

It was jquery/jquery#1756, I don’t think we ever settled on a better hook for someone trying to figure out where the problem is. I suppose we could always have jQuery.error call console.stack or something equally annoying to barf details out for debugging, but we’ve resisted such things in the past.

Yeah, that’s it. Anyone who wants a stack trace is already free to pull it off the Error we throw, but our Syntax error, unrecognized expression: … messages leave much to be desired (as this ticket attests to). We’re also inconsistent about when we throw (tokenize vs. compile), but that’s a separate issue.

For this one, which duplicates jquery/jquery#1756 but is in the correct repository, it’s mostly a question of better prefix text and (to a lesser extent) related concerns about what we show (how much of the selector, error-specific text, etc.). I’m of the opinion that error text in runtime libraries like Sizzle and jQuery bloats size at the expense of people doing things right, but at the same time understand its value for identifying and fixing mistakes (sometimes in third-party code). How about a concise uniform prefix and the offending simple selector (or invalid suffix, when the former cannot be identified)?

Description Selector Error
Missing mandatory argument #list > li:nth-child() .target Unsupported selector: :nth-child()
Prohibited argument #container > :first-child( foo ) Unsupported selector: :first-child( foo )
Unknown pseudo :made-up, :input Unsupported selector: :made-up
Unimplemented pseudo :visited Unsupported selector: :visited
Invalid argument *:lang(en

us)

Unsupported selector: :lang(en

us)

Parse failure *: I Unsupported selector: : I (?)
Unknown combinator Abbot & Costello Unsupported selector: & Costello

In essence, we’d be hinting at the type of the problem and giving clues to track it down, but would not be specific in our complaints.

Источник

Я пытаюсь выбрать :nth-child с помощью jquery, но он показывает синтаксическую ошибку.

Error: Syntax error, unrecognized expression: :nth-child

Вот мой код

var i;
jQuery('#' + id + ' .tab-pane').each(function (id, t) {
    var n = jQuery(this).attr('id', 'pane-' + t);
    var p_id = n.attr('id');
    jQuery('#' + id + ' .nav-tabs li:nth-child(' + i + ') a').attr('href', p_id);
    i++;
});

пожалуйста, проверьте мой код, что здесь отсутствует.

25 июль 2013, в 17:57

Поделиться

Источник

3 ответа

На первой итерации для i нет значения. Таким образом, запрос выглядит так:

jQuery('#' + id + ' .nav-tabs li:nth-child(undefined) a').attr('href', p_id);

При последующих итерациях это будет undefined++, который NaN, который все равно не будет работать.

Это явно не сработает. Решение состоит в том, чтобы установить i в 1 (или любое значение, которое необходимо) в первом цикле:

var i = 1;

lonesomeday
25 июль 2013, в 16:22

Поделиться

jQuery('#'+id+' .tab-pane').each(function(id,t){
    var n = jQuery(this).attr('id','pane-'+t);
    var p_id = n.attr('id');
    jQuery('#'+ p_id).find('.nav-tabs li')
                   .eq(id)
                   .find('a')
                   .attr('href', p_id );
}

Вы можете избавиться от i, так как id является приращением. И я предполагаю, что второй селектор должен использовать p_id, а не id.

Chris Dixon
25 июль 2013, в 16:23

Поделиться

переменная i не назначена undefined

var i;  //undefined
    jQuery('#'+id+' .tab-pane').each(function(id,t){
    var n = jQuery(this).attr('id','pane-'+t);
    var p_id = n.attr('id');
    jQuery('#'+id+' .nav-tabs li:nth-child('+i+') a').attr('href', p_id );
    i++; //still undefined
});

Praveen
25 июль 2013, в 16:12

Поделиться

Ещё вопросы

  • 1Ошибка выполнения Sonar Runner
  • 0Выбор ряда строк, разделенных символом <br> внутри класса
  • 0горизонтальное подменю css не работает
  • 0Docker MySQL ошибка подключения
  • 0Обновить CSS при изменении значения для поля выбора
  • 0Node.js + Espress + MySQL как хранилище документов (результаты)
  • 0Передача информации в функцию обработки ответов jQuery ajax
  • 1Внешний ввод в программу Python во время выполнения
  • 1Использование классов в цикле for в node.js
  • 0mod_rewrite добавление косой черты
  • 1Поиск преемника Inorder в бинарном дереве поиска [дубликаты]
  • 1Selenium webdriver element.click () не работает должным образом (chrome, mocha)
  • 1JS: Фильтр массив только для непустых и тип строковых значений
  • 0Изменение цвета div — HTML
  • 0C ++ Улучшить файл карты памяти
  • 0Запрос SQL и назначить его на JavaScript
  • 0Управление выводом XML с помощью галочки boxws
  • 0Сидите div рядом друг с другом, которые генерируют свою ширину, чтобы заполнить родительский div
  • 1Отображение списка просмотра Android на основе выбора списка
  • 0Сохранять данные $ _POST после перенаправления
  • 0Попытка переместить коробки
  • 0Примечание: неопределенный индекс: идентификатор пользователя в C: xampp htdocs locallocal admin userUpdate.php в строке 5
  • 1Отображаемое имя asp.net не может отображаться
  • 0MySQL удаленное соединение из UWP с ошибкой сокета, но соединение TCP
  • 1Очистка числовых данных в Pandas с apply + лямбда
  • 1Как показать следующий ряд перед тем, как сделать анимацию
  • 1Пользовательское позиционирование заголовка
  • 0Получить src-значение img, ссылаясь на параметр CSS в jQuery
  • 1разделение чисел на сумму позиционных цифр в JavaScript
  • 1Обнаружено недопустимое содержимое, начиная с element-PropertyPlaceholderConfigurer
  • 0как прочитать от 1 до 500 символов из файла в телефоне
  • 1что означает сообщение об ошибке «AFCCreateReSampler: avAFCInfo-> bUsed [0] в SampleRate [44100] outSampleRate [16000]…»?
  • 0$ http.post становится [OPTIONS] в маршруте Rails
  • 0Нерешенное обещание угловое
  • 5Использовать tika с python, runtimeerror: невозможно запустить сервер tika
  • 1Использование Ninject для внедрения IJob из внешней сборки в планировщик Quartz.net
  • 1массив размером 2 — если один из элементов пуст, установите его равным другому
  • 1Словари Python: почему и когда мне приходится использовать иногда «:», а иногда «=» между ключом и значением?
  • 0-webkit-анимация / ключевые кадры не воспроизводятся красиво с -webkit-filter blur
  • 0Сбросить форму начальной загрузки внутри модальной
  • 0Класс с 2 условиями
  • 0Использование jQuery для определения индекса ссылки на основе текста ссылки
  • 1String.Format () уничтожает ссылку в скайпе
  • 0Проверка формы подтверждения магистрали
  • 0При использовании DOM в цикле: Uncaught TypeError: Невозможно прочитать свойство ‘флажок’ с нулевой ошибкой
  • 1Android VideoView не воспроизводит пример видео на T-Mobile G2 (только аудио)
  • 0Текстовое поле не может отображать всю строку из автозаполнения. Как мне сделать так, чтобы оно показывало начало выбранной строки?
  • 0PDO Подготовленные заявления и логические значения
  • 1ошибка: <идентификатор> ожидаемый нм = «Сэм»;
  • 1Zip-архив библиотеки Android

Сообщество Overcoder

Я пытаюсь выбрать :nth-child используя jquery, но он показывает синтаксическую ошибку.

Error: Syntax error, unrecognized expression: :nth-child

Вот мой код

var i;
jQuery('#' + id + ' .tab-pane').each(function (id, t) {
    var n = jQuery(this).attr('id', 'pane-' + t);
    var p_id = n.attr('id');
    jQuery('#' + id + ' .nav-tabs li:nth-child(' + i + ') a').attr('href', p_id);
    i++;
});

пожалуйста, проверьте мой код, чего здесь не хватает

3 ответы

На первой итерации нет значения для i. Таким образом, запрос выглядит следующим образом:

jQuery('#' + id + ' .nav-tabs li:nth-child(undefined) a').attr('href', p_id);

На следующих итерациях будет undefined++, Которая является NaN, который все равно не сработает.

Это явно не сработает. Решение состоит в том, чтобы установить i в 1 (или любое другое значение) в первом цикле:

var i = 1;

Создан 25 июля ’13, 16:07

jQuery('#'+id+' .tab-pane').each(function(id,t){
    var n = jQuery(this).attr('id','pane-'+t);
    var p_id = n.attr('id');
    jQuery('#'+ p_id).find('.nav-tabs li')
                   .eq(id)
                   .find('a')
                   .attr('href', p_id );
}

Вы можете избавиться от i как id является приращением. И я предполагаю, что второй селектор должен использовать p_id а не id.

Создан 25 июля ’13, 16:07

переменная i не назначается undefined

var i;  //undefined
    jQuery('#'+id+' .tab-pane').each(function(id,t){
    var n = jQuery(this).attr('id','pane-'+t);
    var p_id = n.attr('id');
    jQuery('#'+id+' .nav-tabs li:nth-child('+i+') a').attr('href', p_id );
    i++; //still undefined
});

Создан 25 июля ’13, 16:07

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

jquery

or задайте свой вопрос.

By

rus · Posted December 17, 2022

html:
 

<td>
<span class=»qty-minus» onclick=»qtyMinus(); return false;» data-id=»<?=$id;?>» data-qty=»<?= $item[‘qty’];?>» data-weight=»<?=$item[‘weight’];?>»>
<i class=»bi bi-dash-circle-fill text-success»></i>
</span>
<span class=»qty»><?= $item[‘qty’];?></span>
<span class=»qty-plus» onclick=»qtyPlus(); return false;» data-id=»<?=$id;?>» data-qty=»<?= $item[‘qty’];?>» data-weight=»<?=$item[‘weight’];?>»>
<i class=»bi bi-plus-circle-fill text-success»></i>
</span>
</td>

js:
 

// Изменение количества товара в заказа — плюс
function qtyPlus() {
$(‘.qty-plus’).on(‘click’, function(){
let str = $(this).data(‘id’);
if(typeof str === ‘string’){
let id_arr = str.split(‘-‘),
id = id_arr[0],
mod = id_arr[1],
qty_update = $(this).data(‘qty’)+1,
weight = $(this).data(‘weight’);
$.ajax({
url: ‘/cart/add’,
data: {id: id, qty_update: qty_update, mod: mod, weight:weight},
type: ‘GET’,
success: function(res){
showCart(res);
},
error: function(){
alert(‘Ошибка! Попробуйте позже’);
}
});
}else if(!Number.isNaN(str)){
let id = $(this).data(‘id’),
mod = null,
qty_update = $(this).data(‘qty’)+1,
weight = $(this).data(‘weight’);
$.ajax({
url: ‘/cart/add’,
data: {id: id, qty_update: qty_update, mod: mod, weight:weight},
type: ‘GET’,
success: function(res){
showCart(res);
},
error: function(){
alert(‘Ошибка! Попробуйте позже’);
}
});
}
});
return true;
}
// Изменение количества товара в заказа — минус
function qtyMinus() {
$(‘.qty-minus’).on(‘click’, function(){
let str = $(this).data(‘id’);
if(typeof str === ‘string’){
let id_arr = str.split(‘-‘),
id = id_arr[0],
mod = id_arr[1],
qty_update = $(this).data(‘qty’)-1,
weight = $(this).data(‘weight’);
$.ajax({
url: ‘/cart/add’,
data: {id: id, qty_update: qty_update, mod: mod, weight:weight},
type: ‘GET’,
success: function(res){
showCart(res);
},
error: function(){
alert(‘Ошибка! Попробуйте позже’);
}
});
}else if(!Number.isNaN(str)){
let id = $(this).data(‘id’),
mod = null,
qty_update = $(this).data(‘qty’)-1,
weight = $(this).data(‘weight’);
$.ajax({
url: ‘/cart/add’,
data: {id: id, qty_update: qty_update, mod: mod, weight:weight},
type: ‘GET’,
success: function(res){
showCart(res);
},
error: function(){
alert(‘Ошибка! Попробуйте позже’);
}
});
}
});
return true;
}

Суть в том, что клик срабатывает только со второго раза… Почему?
Страница: https://shop-site.su/category/men

Нужно положить товар в корзину и либо в модальном окне, либо перейти на страницу оформления заказа (а лучше и там и там покликать) и покликать на плюс и минус кол-ва товара.

Решил проблему:
убрал из html вызов функции onclick=»qtyMinus(); return false;»

а js переделал вот так:
$(‘body’).on(‘click’, ‘.qty-minus’, function(){…});

Но вот ответ на вопрос почему, все же хотелось бы знать.

Понравилась статья? Поделить с друзьями:
  • Error syntax error at or near raise
  • Error syntax error at or near psql
  • Error syntax error at or near procedure
  • Error syntax error at or near parallel
  • Error syntax error at or near or sqlstate 42601