79516002

Date: 2025-03-18 00:16:12
Score: 1.5
Natty:
Report link

There are several possibilities:

  1. Your request URL seems to be a bit off: Your code makes a request to

xhttp.open("GET", "emotionDetector?textToAnalyze"+"="+textToAnalyze, true);

But this results in a malformed URL, instead try using

xhttp.open("GET", "emotionDetector?textToAnalyze=" + encodeURIComponent(textToAnalyze), true);

The use of encodeURIComponent makes sure any funny stuff in the text, such as special characters gets encoded properly.

  1. Your script is referenced as

src="../static/mywebscript.js"

This means your JavaScript file is expected to be in a static folder at the root level. Flask serves static files from a static/ directory inside your project folder. Try referencing it as

src="{{ url_for('static', filename='mywebscript.js') }}"

Good Luck =D

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Liam Ramirez-Guess