JSON freeCodeCamp

JSON freeCodeCamp
0

#1

What is trigger Click events and how to use it in JSON?


#2

Those are two separate things.

A click event is how your JavaScript (or JQuery) can tell that the user has clicked something with the mouse. It is a piece of code that will run when a click happens in a place the you specify.

https://www.w3schools.com/jsref/event_onclick.asp

JSON is a file/data format that is commonly used to transfer data. Often, if you call out to other web sites to get data, it will be transferred in a JSON file, using an AJAX call (or .getJSON).


#3

I guess to get to your question more specifically, yes, I guess they could be combined. You could wait for the user to click on a button and that event causes you JavaScript to go out and get a JSON from another web site. So, yes, they could be paired together, but they don’t have to be. You can have a click event that has nothing to do with JSON and you can go and get a JSON without ever having a click.