Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script language="JavaScript" type="text/javascript">
  4. function getCustomer(){
  5. var xhr = new XMLHttpRequest();
  6. xhr.open("GET", "/customer/"+customerLogin,false);
  7. xhr.send(null);
  8.  
  9. var data = JSON.parse(xhr.responseText);
  10. var customerPhoto = data.photo.linkLocation;
  11. var customer = data.customers[0];
  12. customerLogin = customer.login;
  13.  
  14. document.getElementById("customerLogin").value = customerLogin;
  15. document.getElementById("customerPassword").value =
  16. customer.password;
  17. document.getElementById("customerName").value = customer.name;
  18. document.getElementById("customerSurname").value = customer.surname;
  19. document.getElementById("customerPhone").value = customer.phone;
  20.  
  21. var img = document.getElementById("customerPhoto");
  22. alert(customerPhoto);
  23. img.setAttribute("src",customerPhoto);
  24. }
  25. </script>
  26. </head>
  27.  
  28. <body class="profile" onload="pageReady();getCustomer();">
  29. <div class="photo">
  30. <br/><img id="customerPhoto" width="500" height="500"><br/></div>
  31. </div>
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement