Last active
December 17, 2015 23:19
-
-
Save metavida/5688269 to your computer and use it in GitHub Desktop.
Sample HTML code that a teacher might paste into a Haiku Learning Embed the Web™ block, and an example of the contents of the JS file, which will pass the login of the current user on to the widget.php page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://your.domainna.me/path/to/widget.js"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
if(HaikuContext && HaikuContext.user) { | |
var widgetURL = 'https://your.domainna.me/path/to/widget.php?'; | |
widgetURL += 'user=' + encodeURIComponent(HaikuContext.user.login) + '&'; | |
if(HaikuContext.user.import_id) | |
widgetURL += 'import_id=' + encodeURIComponent(HaikuContext.user.import_id) + '&'; | |
document.write('<iframe src="' + widgetURL + '" height="200" width="200"></iframe>'); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment