Ajax request to bins
JS Bin supports CORS and a number of different ways to access your bin’s content using Ajax techniques.
- Full HTML output (including JS Bin edit link and live reload scripts)
- Full HTML output (excluding JS Bin edit link etc)
- Single panel output (using .js or .css)
- JSON bin object
Below is a bin that can be tweaked to change the request it’s making so you can see, live, what the impact of that change is:
The example includes prepared ajax requests that are commented out. If you change the line from:
And add a leading
/ to the comment, the code will run:
Try it out and see how the result changes.
TODO: extend this article to show individual ajax requests.
❤️ Love JS Bin?
Support this open source project today, and help it continue to run for another decade 🎂