welcome how to file script.js refer to index.php?
in script.js:
$.post('../php/index.php', {data});
structure directory:
js/
script.js
php/
index.php
index.html
return me in console:
404 (Not Found) Cannot POST /php/index.php
Just use the file location in full, like:
$.post('http://www.example.com/directory/php/index.php', {data});
The url in your javascript has to be relative to the current active url in the web browser. The best way to solve this for you is to use a absolute path. Like this:
$.post('/php/index.php', {data});
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I want a popup to be displayed in a particular format after clickon a button
I have a Voronoi treemap and wanted to change the thickness of the polygons on mouseover
Is there a way to dynamically get a db result in rails? FOr example, I have all of cities indexed with an idI want to sent the id to the view given a city name, like this Javascript method (I know this doesn't work