Still having trouble with NEXT-PREVIOUS buttons for Dynamic Items. Please help.

Hi there,

Building from scratch -a never have code before- have managed to build a database, an index page, and an Item’s page. It looks wonderful to me!

The system gave me already the NEXT-PREVIOUS buttons (in dynamic page mode), that is, it reloads the same page (with the next Item info) instead of just updating the new item, from Item-1 to Item-2 without need to leave the page. The buttons were connected and working to “Next Dynamic Page”. I tryed to link both buttoms to “Next Item” but only disabled them and didn’t work.

I have followed the code instructions to make the Next-Previous item work from this link:
https://support.wix.com/en/article/velo-tutorial-creating-previous-and-next-buttons-for-a-dynamic-item-page-with-code

However, when pasting the code in the Index Page, it showed me this error in the line 23

No idea how to solve it. I wonder if you can give me directions. I feel like a pilot landing a plane for the first time. Calling to control for any help.

Thanks!

Hector

getItems returns an array and you cannot store this as local.setItem expects a string or number.

Convert the array to a string.

Substitue dynamicPageURLs for JSON.stringify(dynamicPageURLs)

When retrieving the variable, if you want to convert back to an array, you will need to use JSON.parse(dynamicPageURLs)

Thanks a lot Iain! Deeply appreciate your input. So… it’s just to substitute “dynamicPageURLs” for “SON.stringify(dynamicPageURLs)”…? Again… Deeply appreciate it!!

“JSON.stringify(dynamicPageURLs)”

Did this fix the issue?