Codepen "not found" error

I completed my JS algorithms and data structures certification, but I wanted the experience of making a mini-site with them on codepen. I’m stuck on the “Palindrome Checker.” The JS works, however every time I submit the text to be checked, CodePen throws an error.

Here is the pen in question:
https://codepen.io/JSchref/pen/ZELmLgw?editors=1011

Open the console, type in a word (palindrome or not) and click “check” to see the problem and the logs showing what of the JS is working.

I’ve tried a couple things to debug it. Inside the JS I’ve got console.log tracking the letter matching and counter. Above each return, I also have a console log indicating success (or failure) of the potential palindrome.

If I call the function in the JS window, it works fine and changes the HTML just like it should.

If I type in some text to check and click “check” I can see that the function runs fine, the matching letters and counter is logged to the console and it makes it to the return statements. But for some reason it throws a 404 error and I can’t figure out why.

I attached two screenshots as well, showing the function working but the error when using the “check” button.


Thanks in advance for any help. :slight_smile:

The form is submitting. Look at preventDefault.

1 Like

Holy cow. Thank you so much. I guess I’ve got some reading to do now, to figure out why it worked.

Thank you again! :smiley:

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.