Posted in jquery
4
4:36 am, October 26, 2021

load json data url with jquery

loads a api or json url or endpoint using jquery and console logs the result

Tested working on my test json file, check the console and it should be there. 

Scripts

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

Javascript

const settings = {
	"async": true,
	"crossDomain": true,
	"url": "https://kruxor.com/js/test_complex_object.json",
	"method": "GET",
	"headers": {
		"my-header-to-send": "value",
		"another-header": "another value"
	}
};

$.ajax(settings).done(function (response) {
	console.log(response);
});

View Statistics
This Week
0
This Month
0
This Year
0

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

Join me on Substack if you want me to send you a collection of the things i have done or found or read for the week. Or follow me on twitter if you prefer, i dont post much but i probably should!

❤👩‍💻🕹

Random Quote


Me