寻找高手给一小段js代码添加点注释,实在看得辛苦
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<title> JSJaC Simple Client </title>
<script type= "text/javascript " src= "../jsjac.js "> </script>
<!-- comment in above and uncomment below if you want to modify/hack
on jsjac -->
<!--script type= "text/javascript " src= "../src/JSJaC.js "> </script-->
<!-- if you want to enable debugging uncomment line below
debugger available at
http://svn.stefan-strigler.de/JSDebugger/trunk -->
<!--script type= "text/javascript " src= "Debugger.js "> </script-->
<script language= "JavaScript " type= "text/javascript ">
// <![CDATA[
function handleIQ(aJSJaCPacket) {
document.getElementById( 'iResp ').innerHTML +=
" <div class= 'msg '> IN (raw): " +aJSJaCPacket.xml().htmlEnc() + ' </div> ';
document.getElementById( 'iResp ').lastChild.scrollIntoView();
}
function handleMessage(aJSJaCPacket) {
var html = ' ';
html += ' <div class= "msg "> <b> Received Message from '+aJSJaCPacket.getFromJID()+ ': </b> <br/> ';
html += aJSJaCPacket.getBody().htmlEnc() + ' </div> ';
document.getElementById( 'iResp ').innerHTML += html;
document.getElementById( 'iResp ').lastChild.scrollIntoView();
}
function handlePresence(aJSJaCPacket) {
var html = ' <div class= "msg "> ';
if (!aJSJaCPacket.getType() && !aJSJaCPacket.getShow())
html += ' <b> '+aJSJaCPacket.getFromJID()+ ' has become available. </b> ';
else {
html += ' <b> '+aJSJaCPacket.getFromJID()+ ' has set his presence to ';
if (aJSJaCPacket.getType())
html += aJSJaCPacket.getType() + '. </b> ';
else