jquery-freeze

Freezes the state of the DOM and serializes as a string.

Usage no npm install needed!

<script type="module">
  import jqueryFreeze from 'https://cdn.skypack.dev/jquery-freeze';
</script>

README

jquery.freeze

jQuery extension for freezing the state of the DOM and serializing as a string. The original use of this was to capture the state of the screen for auditing purposes.

Install

Bower

bower install jquery-freeze

NPM

npm install jquery-freeze

Raw

curl https://raw.github.com/cbmi/jquery.freeze/master/jquery.freeze.js

Include

As a script:

<script src="/path/to/jquery.js"></script>
<script src="/path/to/jquery.freeze.js"></script>

Or as a AMD module:

require(['jquery.freeze'], function($) {
    // ...
});

Use

// Bind to button or listen for a event, freeze the dom and send
// a POST to log the document. The server-side could write the data
// to an HTML file for later viewing.
$('#freezer').click(function(event) {
    event.preventDefault();
    $.post('/screenlog/', $.param({document: $.freeze()}));
});