I'm working on a project using Electron technology to make a desktop app with a local database where I have a navbar and I want to refresh the content of the main section without refresh the whole page.
I know there's ajax but with ajax I should use a web server, so I think that the user should have a web server on his machine to refresh, is there's a way to refresh without a server or to create a "virtual" server with JavaScript please?
I've tried this but it work just with a web server:
$(document).ready(function() {
$(function() {
$('#ideal_form').submit(function(e) {
e.preventDefault();
var form = $(this);
var post_url = form.attr('action');
var post_data = form.serialize();
$('#loader3', form).html('<img src="../../images/ajax-loader.gif" /> Please wait...');
$.ajax({
type: 'POST',
url: post_url,
data: post_data,
success: function(msg) {
$(form).fadeOut(800, function() {
form.html(msg).fadeIn().delay(2000);
});
}
});
});
});
});