|
1 | 1 | <!DOCTYPE html> |
2 | 2 | <html> |
| 3 | + |
3 | 4 | <head> |
4 | 5 | <title>Browser test</title> |
5 | 6 | <script type="text/javascript" src="../../lib/graph-js-sdk-web.js"></script> |
6 | 7 | <script type="text/javascript" src="secrets.js"></script> |
7 | 8 | <script type="text/javascript"> |
8 | 9 | var client = MicrosoftGraph.Client.init({ |
9 | 10 | debugLogging: true, |
10 | | - authProvider: function(done) { |
| 11 | + authProvider: function (done) { |
11 | 12 | done(null, SECRETS.ACCESS_TOKEN); |
12 | 13 | } |
13 | 14 | }); |
|
26 | 27 | // Example of downloading the user's profile photo and displaying it in an img tag |
27 | 28 | client |
28 | 29 | .api('/me/photo/$value') |
29 | | - .responseType(MicrosoftGraph.ResponseType.BLOB) |
| 30 | + .responseType('blob') |
30 | 31 | .get((err, res, rawResponse) => { |
31 | 32 | if (err) throw err; |
32 | 33 |
|
|
57 | 58 | } |
58 | 59 | </script> |
59 | 60 | </head> |
| 61 | + |
60 | 62 | <body> |
61 | | -<h2>Please check the Node.js sample for more examples on calling the Graph.</h2> |
| 63 | + <h2>Please check the Node.js sample for more examples on calling the Graph.</h2> |
62 | 64 |
|
63 | | -<p> |
64 | | -By loading this page, we called /me endpoint on the Microsoft Graph. Open your browser's' JavaScript console to see the result! |
65 | | -</p> |
66 | | -<br> |
67 | | -<p>Your user photo from /me/photo/$value:</p> |
68 | | -<img id="profileImg" /> |
69 | | -<p> |
70 | | -Also, you can update your profile picture: |
71 | | -<input type="file" onchange="updateProfilePicture()"><br> |
72 | | -</p> |
73 | | -<br> |
| 65 | + <p> |
| 66 | + By loading this page, we called /me endpoint on the Microsoft Graph. Open your browser's' JavaScript console to see the result! |
| 67 | + </p> |
| 68 | + <br> |
| 69 | + <p>Your user photo from /me/photo/$value:</p> |
| 70 | + <img id="profileImg" /> |
| 71 | + <p> |
| 72 | + Also, you can update your profile picture: |
| 73 | + <input type="file" onchange="updateProfilePicture()"> |
| 74 | + <br> |
| 75 | + </p> |
| 76 | + <br> |
74 | 77 |
|
75 | 78 | </body> |
| 79 | + |
76 | 80 | </html> |
0 commit comments