Guest User

Untitled

a guest
Jan 14th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. function callScripto() {
  2. try {
  3. //create the XMLHttpRequest object
  4. netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
  5. } catch (e) {}
  6. var xmlHttpReq = false;
  7. var self = this;
  8. if (window.XMLHttpRequest) {
  9. self.xmlHttpReq = new XMLHttpRequest();
  10. }
  11. else if (window.ActiveXObject) {
  12. self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
  13. }
  14. // pass in the login credentials from the form into the url
  15. var form = document.forms['f1'];
  16. var username = form.username.value;
  17. var password = form.password.value;
  18. var url = scriptoURL + scriptName1 + "?username=" + username + "&password=" + password;
  19. // post the parameters to Scripto via the url
  20. self.xmlHttpReq.open('POST', url, true);
  21. self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  22. self.xmlHttpReq.onreadystatechange = function() {
  23. // when the response is returned, call the getjson() function on the returned string
  24. if (self.xmlHttpReq.readyState == 4) {
  25. getjson(self.xmlHttpReq.responseText);
  26. }
  27. }
  28. self.xmlHttpReq.send();
  29. }
Add Comment
Please, Sign In to add comment