Posted in jquery
4
3:34 am, March 15, 2021

json jquery ajax request

get json data with jquery using getJSON

Javascript

$.getJSON('https://my_url/stuff.json', { get_param: 'value' }, function(data) {
    $.each(data, function(index, element) {
        $('target').append($('<div>', {
            text: element.name
        }));
    });
});

View Statistics
This Week
8
This Month
32
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
Our brains are wired to find things we are looking for - if your always cynical or waiting for things to go wrong, then your life will reflect that. On the other hand, having a positive outlook on life will bring you joy and provide you with inspiration when you least expect it ☀️🍉🌴
Unknown