$(document).ready(function () { $("#blink").on('click',function(){ let url = '/cgi-bin/test.cgi?action=blink'; let postData = { } $.ajax({ type: 'POST', url: url, data: postData, dataType: "json", //contentType: "application/json; charset=utf-8", success: function (res) { if (res.success) { data = res.content } else { alert(res.message) } }, error: function (res) { } }) }) })