I have a JavaScript file that is used for a google chrome extension, Also I have a Python file which has functions in it, only for the example let's imagine that in the python file we have a function like so
external.py
def name(x)
return "your" + x
So I want to call this function through JavaScript and get the return value inside of JavaScript, so if the Python file named external.py and the JS file named index.js for example, so the code will JS be something like that
index.js
data = "external.py".name("John") //(It doesn't have to be like that, just for the example)
I've tried using ajax but it does not work (I've tried to import jquery way too many times, but it doesn't seem to work) maybe because it's a google chrome extension. Also, I've tried to use fetch but I have no idea how to write it exactly and if it's impossible with fetch.
I am new to JS though, so go easy with me.