1conn.write("HTTP/1.0 200 OK\r\n") 2conn.write("Content-Type: text/html\r\n") 3conn.write("\r\n") 4conn.write("<html><body>\r\n") 5conn.write("<p>This is an example of a server side JavaScript, served by the ") 6conn.write('<a href="https://github.com/civetweb/civetweb/">CivetWeb web server</a>.') 7conn.write("</p>\r\n") 8 9 10function print_elements(title, obj) 11{ 12 conn.write("<p>\r\n"); 13 conn.write("<b>" + title + "</b><br>\r\n"); 14 elms = Object.getOwnPropertyNames(obj) 15 16 for (var i = 0; i < elms.length; i++) { 17 conn.write(JSON.stringify(elms[i]) + ":<br>\r\n") 18 conn.write("Type: " + typeof(obj[elms[i]]) + "<br>\r\n") 19 conn.write(JSON.stringify(Object.getOwnPropertyDescriptor(obj, elms[i])) + "<br>\r\n") 20 conn.write("<br>\r\n") 21 } 22 conn.write('<br></p>\r\n') 23} 24 25 26print_elements("conn", conn) 27print_elements("civetweb", civetweb) 28 29 30conn.write('</body></html>\r\n') 31