form.js 700 B

123456789101112131415161718192021222324252627282930
  1. var ak_js = document.getElementById( "ak_js" );
  2. if ( ! ak_js ) {
  3. ak_js = document.createElement( 'input' );
  4. ak_js.setAttribute( 'id', 'ak_js' );
  5. ak_js.setAttribute( 'name', 'ak_js' );
  6. ak_js.setAttribute( 'type', 'hidden' );
  7. }
  8. else {
  9. ak_js.parentNode.removeChild( ak_js );
  10. }
  11. ak_js.setAttribute( 'value', ( new Date() ).getTime() );
  12. var commentForm = document.getElementById( 'commentform' );
  13. if ( commentForm ) {
  14. commentForm.appendChild( ak_js );
  15. }
  16. else {
  17. var replyRowContainer = document.getElementById( 'replyrow' );
  18. if ( replyRowContainer ) {
  19. var children = replyRowContainer.getElementsByTagName( 'td' );
  20. if ( children.length > 0 ) {
  21. children[0].appendChild( ak_js );
  22. }
  23. }
  24. }