Javascript/Javascript

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ] ์กฐ์ฝ”๋”ฉ-์นด์นด์˜คAPI ํ™œ์šฉ์‹ค์Šต

Rainbow๐ŸŒˆCoder 2022. 5. 7. 16:03
728x90

[Node.js] ๋ฌด์‹ ์‚ฌ ์ƒํ’ˆ ์žฌ์ž…๊ณ  ์•Œ๋ฆผ ๋งŒ๋“ค๊ธฐ (ver 1.1) :: ์ฝ”๋”ฉ ๊ณต๋ถ€ ์ผ์ง€ (tistory.com)

 

[Node.js] ๋ฌด์‹ ์‚ฌ ์ƒํ’ˆ ์žฌ์ž…๊ณ  ์•Œ๋ฆผ ๋งŒ๋“ค๊ธฐ (ver 1.1)

<์ด์ „ ver 1.0 ๊ฐœ๋ฐœ ํฌ์ŠคํŒ…> https://cocoon1787.tistory.com/741 [Node.js] Node + Kakao API๋กœ ์ƒํ’ˆ ์žฌ์ž…๊ณ  ์•Œ๋ฆผ ๋งŒ๋“ค๊ธฐ (ver 1.0) ๐Ÿš€ ์ด์ œ ๋‚ ์ด ์Šฌ์Šฌ ์ถ”์›Œ์ง€๊ธฐ ์‹œ์ž‘ํ•˜๋Š” ๊ฒƒ ๊ฐ™๊ณ  ํŒจ๋”ฉ๋„ ์ข€ ํ•„์š”ํ•ด์„œ ๋ฌด์‹ ์‚ฌ์—..

cocoon1787.tistory.com

๊ฐœ๋ฐœ ๊ฐ€์ด๋“œ | Kakao Developers ๋ฌธ์„œ

 

Kakao Developers

์นด์นด์˜ค API๋ฅผ ํ™œ์šฉํ•˜์—ฌ ๋‹ค์–‘ํ•œ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๊ฐœ๋ฐœํ•ด๋ณด์„ธ์š”. ์นด์นด์˜ค ๋กœ๊ทธ์ธ, ๋ฉ”์‹œ์ง€ ๋ณด๋‚ด๊ธฐ, ์นœ๊ตฌ API, ์ธ๊ณต์ง€๋Šฅ API ๋“ฑ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

developers.kakao.com

jQuery

 

jQuery

What is jQuery? jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.

jquery.com

Downloading jQuery using npm or Yarn

jQuery is registered as a package on npm. You can install the latest version of jQuery with the npm CLI command:

npm install jquery

Ajax

Call a local script on the server /api/getWeather with the query parameter zipcode=97201 and replace the element #weather-temp's html with the returned text.

$.ajax({
  url: "/api/getWeather",
  data: {
    zipcode: 97201
  },
  success: function( result ) {
    $( "#weather-temp" ).html( "<strong>" + result + "</strong> degrees" );
  }
});

 

 

jQuery.ajax() | jQuery API Documentation

Description: Perform an asynchronous HTTP (Ajax) request. The $.ajax() function underlies all Ajax requests sent by jQuery. It is often unnecessary to directly call this function, as several higher-level alternatives like $.get() and .load() are available

api.jquery.com

Examples:

Save some data to the server and notify the user once it's complete.

 
$.ajax({
  method: "POST",
  url: "some.php",
  data: { name: "John", location: "Boston" }
})
  .done(function( msg ) {
    alert( "Data Saved: " + msg );
  });

 

AJAX ์ฝ”๋“œ ์ƒ๋‹จ์—๋Š” ์š”์ฒญ์— ๋Œ€ํ•œ ์ •๋ณด๊ฐ€ ๋“ค์–ด๊ฐ„๋‹ค.

    <script>
      $.ajax({
        method: "POST", //์ „์†ก๋ฐฉ์‹
        url: "some.php",  //์ „์†ก์ฃผ์†Œ
        data: { name: "John", location: "Boston" }, //๋ณด๋‚ผ ๋ฐ์ดํ„ฐ
      }).done(function (msg) {
        alert("Data Saved: " + msg);
      });

 

done ์ดํ›„์—๋Š” ์š”์ฒญ์— ๋Œ€ํ•œ ์‘๋‹ต์ด ์˜ค๋ฉด ์‘๋‹ต์„ ๊ฐ€์ง€๊ณ  ์–ด๋–ค ์ฒ˜๋ฆฌ๋ฅผ ํ•˜๋Š” ์ฝ”๋“œ๊ฐ€ ๋“ค์–ด๊ฐ€๊ฒŒ ๋œ๋‹ค.
    </script>

728x90