Skip to content

Instantly share code, notes, and snippets.

@adminho
adminho / highcharts_example.html
Created November 19, 2018 03:52
ตัวอย่างการใช้ไลบรารี่ highcharts.js
<html>
<!-- document https://www.highcharts.com/docs/getting-started/installation -->
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
</head>
<body>
<div id="container" style="width:100%; height:400px;"></div>
<script>
@adminho
adminho / ตัวอย่างโค้ด Node.js
Last active March 1, 2023 04:08
ตัวอย่างโค้ด เรียกใช้ API เพื่อดูข้อมูลอุตุนิยมวิทยาและแผ่นดินไหว ผ่าน Web API ของกรมอุตุนิยมวิทยา
/*
คู่มือ API ของกรมอุตุฯ มีอยู่ 11 API ให้เลือกใช้
http://data.tmd.go.th/api/doc/reference/WeatherToday.pdf
อย่าลืมลงทะเบียนเพื่อขอ uid กับ demokey
http://data.tmd.go.th/api/index1.php
*/
// must intall this package
// npm install request
var request = require('request');
@adminho
adminho / ตัวอย่างโค้ด HTML and Javascript.html
Last active January 23, 2018 03:52
ตัวอย่างโค้ดเรียกใช้งานบริการ API ของธนาคารแห่งประเทศไทย
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
//อ้างอิงคู่มือ ตามลิงค์นี้ https://iapi.bot.or.th/Developer?lang=th
// ตัวอย่างดู อัตราแลกเปลี่ยนถัวเฉลี่ยถ่วงน้ำหนักระหว่างธนาคาร (รายวัน)
$("button").click(function(){
$.ajax({