Changes

Jump to: navigation, search

Umlaut partial html API javascript helper

647 bytes added, 16:22, 19 June 2012
no edit summary
=WARNING: This is Outdated Documentation!!!!=
 
'''THIS IS OUTDATED DOCUMENTATION''' See new Umlaut documentation at http://github.com/team-umlaut/umlaut/wiki
---------
 
THE CODE DOCUMENTED HERE IS DEPRECATED. PLEASE SEE INSTEAD: [[JQuery HTML Updater]]
 
If you want to include [[Umlaut]]-generated HTML directly on a third party page via javascript, there is a javascript helper script to make that very easy. This helper uses the [[Umlaut partial html API]], but does everything for you. The helper will update your divs, and keep polling Umlaut for new results, continuing to re-update your divs until Umlaut is finished. How often it polls is configured by application config 'poll_wait_seconds', which defaults to 4 seconds.
== Overview ==
Your page needs to include the JS Prototype library. Currently, automatic inclusion of the Prototype library isn't working, so you'll need to include a <script> line to do so. You can link to the prototype library in Umlaut, see example below.  You will first then include an Umlaut javascript file, and then call the embedUmlaut() js function it supplies. You'll need to pass some arguments to embedUmlaut. :
=== Umlaut base URL ===
};
</script>
 
<!-- include the prototype library -->
<script type="text/javascript" src="http://umlaut.university.edu/javascripts/prototype.js"></script>
 
<!-- now actually load the umlaut js helper, which will do the magic for you -->
<script type="text/javascript" src="http://umlaut.university.edu/javascripts/embed/umlaut-embed-func.js.js"></script> 
<!-- and call embedUmlaut -->
<script type="text/javascript">
</script>
</script>

Navigation menu