Submit form using jquery/javascript without refreshing the page


I am trying to do task using js in uipth. The page getting refresh when I am submitting form using jQuery, so couldn’t proceed to next round. Is there any way to submit form without refreshing the page?

Below is the code.
function my_function(e, input_name)
var head = document.getElementsByTagName(“head”)[0];
var script = document.createElement(“script”);
script.src = “//”;
script.onload = function() {
$( “#randomForm” ).submit();