Creating a "like / unlike" button

This post may be outside the scope of Webflow since it deals with JavaScript and an API call to the Xano backend. That said, there’s some interesting elements here.

I created a page that generates a grid of images. I want a user to be able to query the images in a flexible manner, a manner not available in the Webflow CMS so I’m using Xano as a back end.

One of the features of the site is for visitors to “like” images or “favorites” to create a personalized portfolio. The functionality of the “like / unlike” button displays a grey or red heart on the page. The JavaScript on the page captures the user id and the image id and would normally log that in a table in Xano - except “Whoops” I’m getting a 404 error and the API call fails.


The error reference is to Webflow JS

Access to the JS code is in the orange and green divs at the bottom of the page in an embed tag. The “orange” embed is for the click handler and modeled off of Handling Events for Multiple Elements video

My Webflow page is currently configured in “debugging mode” with some hard coded parameters.

Any help with the 404 error greatly appreciated.

https://preview.webflow.com/preview/davids-cool-project-9b22c7?utm_medium=preview_link&utm_source=designer&utm_content=davids-cool-project-9b22c7&preview=454984bc0992fefc4eb788f0bcda7382&pageId=619e936184f97ca3728c9492&workflow=preview


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Hey, David! Chris from Xano here. Were you ever able to solve this? I’d be happy to help, if not. We’d want to start by checking the endpoint URL you’re calling, because we’re getting a 404.