-1

I made a simmple example at fidle. https://jsfiddle.net/johi123/0xdvq3wp/10/

from my project: Always say me there is no id set.
url:
https://hiti-seo.com/seo-suchmaschinen-optimierung/news/seo-news.html#MUM - Eine neue Ära der Suche beginnt

console message:
Uncaught TypeError: $(...).offset() is undefined

I don't know why it"s say Problem is at $('')offset, the problem is the second headline id ="#MUM - Eine neue Ära der Suche beginnt" who i set.

jörg
  • 23
  • 6

2 Answers2

0

I think you should give the name of the attribute:

var wichid=$('li:eq(0)').attr();

=>

var wichid=$('li:eq(0)').attr("id");

isherwood
  • 58,414
  • 16
  • 114
  • 157
Efraim
  • 26
  • 2
  • my problem is that i cant use scroll function to an seted id. If i would set the id direct in html it would work. But i need to use the headlines as id . One work arround could be to reload the site if this is still working in 2022 but has perfomance issues. Thats why i need help cause i run against this wall not the first time :-)) – jörg Mar 25 '22 at 23:03
0

Its the empty space in the id , that was the Problem .

Anyway thank you for try to help.

jörg
  • 23
  • 6