Min Shin,
Here is your code working. I had to add all the proxy stuff so that I could hit your server from my webserver, you will most likely not need any of that.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>Request data from a remote server - 4.12</title>
<style>
html,
body,
#container {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
.container {
padding: 1em;
}
#btnQuery {
overflow: auto;
text-align: center;
cursor: pointer;
font-size: 1em;
}
input {
width: 75%;
}
#viewDiv {
width: 500px;
height: 500px;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.12/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.12/"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<div class="container esri-widget">
<div>
<h2>Using esri/request</h2>
<button id="btnQuery">Make Request</button>
<input id="inputUrl" type="text" value="
</div>
<pre id="resultsDiv"></pre>
<div id="viewDiv"></div>
<div id="bookmarks"></div>
</div>
<script>
require([
"esri/request",
"esri/Map",
"esri/views/MapView",
"esri/geometry/Polygon",
"esri/config",
"esri/core/urlUtils"
], function(
esriRequest,
Map,
MapView,
Polygon,
esriConfig,
urlUtils) {
esriConfig.request.proxyUrl = "./proxy/proxy.ashx";
esriConfig.request.trustedServers.push("https://gisportal.kisti.re.kr");
urlUtils.addProxyRule({proxyUrl: "./proxy/proxy.ashx", urlPrefix: "https://gisportal.kisti.re.kr"});
var map = new Map({
basemap: "streets"
});
var view = new MapView({
container: "viewDiv",
map: map,
zoom: 12,
center: [127.6, 37.5]
});
var resultsDiv = document.getElementById("resultsDiv");
var input = document.getElementById("inputUrl");
$("#btnQuery").click(function() {
esriRequest("https://gisportal.kisti.re.kr/server/rest/services/GBSK/%EC%9D%B8%EC%B2%9C%EC%8B%9C_%ED%96%89%EC%A0%95%EB%8F%99/MapServer/1/query?where=1%3D1&outFields=*&returnGeometry=true&outSR=%7Bwkid%3A4326%7D&f=json", {
responseType: "json"
}).then(function(response){
response.data.features.forEach(feature => {
console.log(feature['attributes']['sig_kor_nm'])
var btn = document.createElement("button");
btn.innerHTML = feature['attributes']['sig_kor_nm'];
btn.addEventListener("click", function(e) {
const polygon = Polygon.fromJSON(feature.geometry);
view.goTo({
geometry: polygon
});
});
document.getElementById("bookmarks").appendChild(btn);
});
});
})
});
</script>
</body>
</html>