HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/dev/nowruzgan/rest/node_modules/js-beautify/js/test/requirejs-html-beautify.html
<!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>