Form form cross-domain submission without the use of jq can achieve no jump page can also be callback?

keyword: form cross-domain submission, no jq, no jump, no refresh, get the returned value

now I"m going to use the form form to implement cross-domain submission, but jq is not introduced in the code (and I"m not going to introduce it. The methods of ajaxForm and ajaxSubmit in jq can be implemented). How can I simulate these two methods through js, or there are other better ways to implement them (which can"t be changed in the background now)

< form id= "form" action= http://*/api/gateway" method= "post" enctype= "multipart/form-data" >
< input type= "file" name= "file" id= "upload_file" >
< input type= "hidden" name= "appKey" value= "appKey" >
< input type= "hidden" name= "pampasCall" value= "pampasCall" >
< input type= "hidden" name= "pathName" value= "pathName" > < pathName > Timestamp ">
< button type=" submit "> submit < / button >
< / form >

Mar.15,2021

if you submit with native form, you must jump
you can either create a request directly with xmlhttprequest/fetch (block form submission events), or write an ajax or something


.
function submit(){
   $('-sharpform').submit();
  return false;
}
Menu