First, my javascript code as follows.
var $ = require('jquery');
var url_path = "http://192.168.1.232:9000/get";
$.ajax({
type: "GET",
url: "http://192.168.1.232:9000/get?callback=?",
dataType: 'jsonp',
async: true,
error: function () {
alert("Error is occured...");
},
success: function(data) {
console.log("send to cli cuccessfully!!!");
}
});
But when I type 'node server.js' on terminal, the error occured saying "$.ajax is not a function". Then I found the solution to handle this by adding
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
But I have javascript file only, how can I solve this issue?