Error using selector


#1

I’m using the following selector that works using jQuery, but not Dom7:

$$(’.page-current #LevelList tbody:last’).append(html);

I’m getting the following error:

[Error] SyntaxError: The string did not match the expected pattern.
querySelectorAll (framework7.bundle.min.js:13:13489)
$ (framework7.bundle.min.js:13:13489)
AddLevel (time_calc.js:255)
(anonymous function) (time_calc.js:159)
l (framework7.bundle.min.js:13:17567)

I’m on F7 V4.4.0


#2

Dom7 is not jQuery and it doesn’t have such hacks. Use correct CSS selectors, you probably need :last-child https://www.w3.org/TR/2018/CR-selectors-3-20180130/#last-child-pseudo

$$('.page-current #LevelList tbody:last-child').append(html);

or if last matching element

$$('.page-current #LevelList tbody').eq(-1).append(html);