Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <%@ page import="canvas.SignedRequest" %>
  2.  
  3. <title>Hello World Canvas Example</title>
  4.  
  5. <link rel="stylesheet" type="text/css" href="/sdk/css/canvas.css" />
  6.  
  7. <!-- Include all the canvas JS dependencies in one file -->
  8. <script type="text/javascript" src="/sdk/js/canvas-all.js"></script>
  9. <!-- Third part libraries, substitute with your own -->
  10. <script type="text/javascript" src="/scripts/json2.js"></script>
  11.  
  12. <script>
  13. if (self === top) {
  14. // Not in Iframe
  15. alert("This canvas app must be included within an iframe");
  16. }
  17.  
  18. Sfdc.canvas(function() {
  19. var sr = JSON.parse('<%=signedRequestJson%>');
  20. // Save the token
  21. Sfdc.canvas.oauth.token(sr.oauthToken);
  22. Sfdc.canvas.byId('username').innerHTML = sr.context.user.fullName;
  23. });
  24.  
  25. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement