Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

what to write in data parameter of JS ajax call

$
0
0

The goal of my project is a website that can show a list of addresses that updates without refreshing which means I have to use AJAX. I hope to include Javascript. the current code I have is the following:

<script src="https://code.jquery.com/jquery-3.1.1.min.js">
jQuery(document).ready(function ($) {
    $('#get-data').click(function () {
        var showData = $('#show-data');
        $.ajax({
            type: 'GET',
            url: 'json.json',

        })
    })
})

while looking at the $.ajax() I've seen the data parameter often used but I have no clue what it's purpose is or what I should insert into it. I've read multiple documentations yet I still don't understand what I'm supposed to write in the data parameter. I've looked at different StackOverflow questions aswell but they haven't brought me any further.

It'd be helpful if someone could help me with this. I'm having quite some problems just trying to figure out AJAX Calls in general.


Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>