Feb
15
Posted on 2006-02-15
Filed Under (Domino/Notes, JavaScript) by Johan Känngård

This has been done before. Here is my contribution:


/**
 * Replaces "No Documents Found" with a custom text.
 *
 * @author Johan Känngård, http://johankanngard.net
 * @param message the text to replace with
 *
 */
function replaceNoDocumentsFound(message){
  var h2=document.getElementsByTagName('h2');
  if(h2!='undefined'&&h2.length>0&&h2[0]!='undefined') {
    var oldTextNode=h2[0].firstChild;
    var newTextNode=document.createTextNode(message);
    h2[0].replaceChild(newTextNode,oldTextNode);
  }
}

Put the function in the HTML Head (or in an imported JS-file) and call the function at the bottom at the page like this:


<script type="text/javascript">
replaceNoDocumentsFound('Sorry, I could not find anything');
</script>

The easiest way to hide the text is via a stylesheet like this:

<style type="text/css">
H2 {display:none;}
</style>

…but you already knew that, huh?
[tags]JavaScript, DOM, Lotus Domino, CSS[/tags]

    Read More   
Post a Comment
Name:
Email:
Website:
Comments: