rem: $( "#citationCountDisplay" ).html( document.getElementById( "citationCount" ).value ); 
add: if( document.getElementById( "citationCountDisplay" ) && document.getElementById( "citationCount" ) ) { $( "#citationCountDisplay" ).html( document.getElementById( "citationCount" ).value ); } 
context: function toggleCitation( baseUrl, citationButton, collectionId, spinnerId, addLabel, removeLabel ){  if(citationButton && citationButton.value)  {    // switch to spinner    $( "#" + citationButton.id ).hide();    $( "#" + spinnerId ).show();        // disable inputs    $( "input" ).attr( "disabled", "disabled" );    if( addLabel == citationButton.value )    {      // do AJAX load      $( "#messageDiv" ).load( baseUrl + "&sakai_action=doMessageFrame&collectionId=" + collectionId + "&citationId=" + citationButton.id + "&operation=add",        function() {          // update the button's id using the value from the AJAX response          document.getElementById( citationButton.id ).id = document.getElementById( "addedCitationId" ).value;                    // update the citation list count using the value from the AJAX response          $( "#citationCountDisplay" ).html( document.getElementById( "citationCount" ).value );                    // hide the spinner          $( "#" + spinnerId ).hide();          $( "#" + citationButton.id ).show();                    // change label to remove          citationButton.value = removeLabel;                    // change highlighting          highlightButtonSelections( removeLabel );                    // enable inputs          $( "input" ).attr( "disabled", "" );        } );    }    else    {      // do AJAX load      $( "#messageDiv" ).load( baseUrl + "&sakai_action=doMessageFrame&collectionId=" + collectionId + "&citationId=" + citationButton.id + "&operation=remove",        function() {          // update the citation list count using the value from the AJAX response          $( "#citationCountDisplay" ).html( document.getElementById( "citationCount" ).value );          // hide the spinner          $( "#" + spinnerId ).hide();          $( "#" + citationButton.id ).show();                    // change label to add          citationButton.value = addLabel;                    // change highlighting          highlightButtonSelections( removeLabel );                    // enable inputs          $( "input" ).attr( "disabled", "" );        } );    }  }}
meta: 1235	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1235/bb819f5dafe274fc330a4166f88f38075487d06a/citationscript.js/clean/citations/citations-tool/tool/src/webapp/js/citationscript.js