When you open your widget locally (like from file://...
), the browser blocks AJAX calls to your PHP server due to CORS restrictions and security policies around local files.
To fix this, do :
Instead of double-clicking the HTML file, serve it using a local server. If you have PHP installed, you can do this easily:
php -S localhost:8000
Then open the widget in your browser using:
http://localhost:8000/index.html
Now the browser treats it like a normal web page, and AJAX calls to your PHP server will work (assuming the server allows it).