Hi,
I haven't tested your posted code, because I couldn't replicate it in its fullest. However I tested a code based on what you posted and found no issues. Thing really works fine.
So, you didn't post your initial template code and made our efforts over-complicated, because I had to reconstruct the template with links and therefore the error is still present in your initial code. I suggest you post it as well, because I used my own links and a simple jsonurl instead. I suspect the error is indeed in jsonurl or links in <li> elements.
I attach the template that I used. I created 2 cloned pages of it and assigned both to a folder. In jsonurl I put my custom url with all expected parameters. Ajax code was left intact.
I haven't tested your posted code, because I couldn't replicate it in its fullest. However I tested a code based on what you posted and found no issues. Thing really works fine.
So, you didn't post your initial template code and made our efforts over-complicated, because I had to reconstruct the template with links and therefore the error is still present in your initial code. I suggest you post it as well, because I used my own links and a simple jsonurl instead. I suspect the error is indeed in jsonurl or links in <li> elements.
I attach the template that I used. I created 2 cloned pages of it and assigned both to a folder. In jsonurl I put my custom url with all expected parameters. Ajax code was left intact.