<hr>
<h6><a href="?/page/samples.dhkx-test">DHKX Test</a></h6>
<script>
// v.20231117
const jsDhkxExchangeStep1 = () => {
	//const bas = smartJ$DhKx.getBaseGen();
	const bas = '[###SRV-BASE|js###]';
	const cli = smartJ$DhKx.getCliData(bas);
	const srvPub = '[###SRV-PUB|js###]';
	const shad = smartJ$DhKx.getCliShad(cli.sec, srvPub);
	console.log('DHKX Next Request Client.Shad', shad);
	jQuery('pre#dhkx-dbg-cli-data').text(JSON.stringify(String(cli), null, 4));
	smartJ$Browser.setCookie('testDhkx_SrvPub', srvPub);
	smartJ$Browser.setCookie('testDhkx_CliPub', cli.pub);
	smartJ$Browser.setCookie('testDhkx_CliShad', shad);
};
const jsDhkxExchangeStep2 = () => {
	const cliShad = String(jQuery('span#dhkx-prev-cli-shad').text() || '');
	const srvShad = String(jQuery('span#dhkx-test-srv-shad').text() || ''); // this is N/A on 1st run ...
	if(cliShad !== srvShad) {
		const msg = 'Server.Shad != Client.Shad';
		smartJ$Browser.GrowlNotificationAdd('DHKX Test Error', smartJ$Utils.escape_html(msg), null, 0, true, 'error');
	}
};
</script>
<div>
Prev-Cli-Pub:  `<span id="dhkx-prev-cli-pub">[###CLI-PREV-PUB|html###]</span>`<br>
Prev-Cli-Shad: `<span id="dhkx-prev-cli-shad" style="font-weight:bold; font-style:italic;">[###CLI-PREV-SHAD|html###]</span>`<br>
Test-Srv-Shad: `<span id="dhkx-test-srv-shad" style="font-weight:bold; font-style:italic;">[###SRV-PREV-SHAD|html###]</span>`<br>
Prev-Srv-Sec:  `<span id="dhkx-prev-srv-sec">[###SRV-PREV-SEC|html###]</span>`<br>
Prev-Srv-Pub:  `<span id="dhkx-prev-srv-pub">[###SRV-PREV-PUB|html###]</span>`<br>
</div>
Server-Data (debug only):
<pre id="dhkx-dbg-srv-data" style="margin-top:0 !important; margin-bottom:0 !important;">[###SRV-DATA|jsonpretty|html###]</pre>
Client-Data (debug only):
<pre id="dhkx-dbg-cli-data" style="margin-top:0 !important; margin-bottom:0 !important;"></pre>
<script>
jsDhkxExchangeStep1();
jsDhkxExchangeStep2();
</script>
<hr>