Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script language="JavaScript" type="text/javascript">
- function getCustomer(){
- var xhr = new XMLHttpRequest();
- xhr.open("GET", "/customer/"+customerLogin,false);
- xhr.send(null);
- var data = JSON.parse(xhr.responseText);
- var customerPhoto = data.photo.linkLocation;
- var customer = data.customers[0];
- customerLogin = customer.login;
- document.getElementById("customerLogin").value = customerLogin;
- document.getElementById("customerPassword").value =
- customer.password;
- document.getElementById("customerName").value = customer.name;
- document.getElementById("customerSurname").value = customer.surname;
- document.getElementById("customerPhone").value = customer.phone;
- var img = document.getElementById("customerPhoto");
- alert(customerPhoto);
- img.setAttribute("src",customerPhoto);
- }
- </script>
- </head>
- <body class="profile" onload="pageReady();getCustomer();">
- <div class="photo">
- <br/><img id="customerPhoto" width="500" height="500"><br/></div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement