UNPKG

jsdoc-75lb

Version:

An API documentation generator for JavaScript.

58 lines (47 loc) 1.25 kB
<!doctype html> <html lang="en-US"> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script> <script type="text/javascript"> require(["../lib/beautify-html"],function(html_beautify){ var input = document.getElementById("input").value; var output = html_beautify.html_beautify(input); document.getElementById("output").innerHTML = output; }); </script> <style type="text/css"> #output{ border: 1px solid black; height: 300px; width: 100%; } #input{ width: 100%; height: 300px; } </style> </head> <body> <h1>RequireJS test</h1> <p> This example loads the html-beautifier by using a relative path in the require call to the beautify-html.js file. (also works works with absolute paths) </p> <pre> require(["../lib/beautify-html"],function(html_beautify){ var input = document.getElementById("input").value; var output = html_beautify.html_beautify(input); document.getElementById("output").innerHTML = output; }); </pre> <h2>Input</h2> <textarea name="" id="input"> <ul><li><a href="test"></a></li></ul> </textarea> <h2>Output</h2> <textarea name="" id="output"> </textarea> </body> </html>