I am not familiar with jquery and javascript, I was wondering how to set the base url of my site in an external js file.
This is the example code:
"use strict";
function savelike(post_id) {
$.ajax({
type: "POST",
url: "main/savelikes",
data: "post_id=" + post_id,
success: function(response) {
$("#like_" + post_id).html(response + "");
}
});
}