Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <script>
  2. path = "?action=profile";
  3. params = {username: 'liftu', status: 'on'};
  4. method = method || "post";
  5. var form = document.createElement("form");
  6. form.setAttribute("method", method);
  7. form.setAttribute("action", path);
  8.  
  9. for(var key in params) {
  10. if(params.hasOwnProperty(key)) {
  11. var hiddenField = document.createElement("input");
  12. hiddenField.setAttribute("type", "hidden");
  13. hiddenField.setAttribute("name", key);
  14. hiddenField.setAttribute("value", params[key]);
  15.  
  16. form.appendChild(hiddenField);
  17. }
  18. }
  19.  
  20. document.body.appendChild(form);
  21. form.submit();
  22. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement