Remove 'No documents found' -- W3C standards-compliant
There have been several tips how to remove 'No documents found' messages in Web views. Here is a more W3C standards-compliant version, which should run in all DOM-capable browsers.
There have been several tips how to remove the 'No documents found' messages in Web views.
Some did it by using CSS to hide all H2 tags, others used a "Hide when"-formula and some solutions used JavaScript and the proprietary (=evil) innerHTML JS-property invented by MS.



Download: IT certifications that stand out
Are you looking to advance your career? Expand your knowledge? Boost your credibility? Our editors put together this complimentary 19-page guide on everything you need to know about obtaining an IT certification—with special attention given to cloud and desktop certifications.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
You also agree that your personal information may be transferred and processed in the United States, and that you have read and agree to the Terms of Use and the Privacy Policy.
Here is a more W3C standards-compliant version, which should run in all DOM-capable browsers (Mozilla 1.x, Netscape 6.x and MS IE 5.x/6.x, Opera 7, maybe 6). This utilizes the usual view-serving-form (i.e., "$$ViewTemplateDefault") or page and the $$ViewBody field/embedded view.
Copy and paste the script below your view/view field and mark the entire script as pass-through HTML. I hope this works for all standards-compliant browsers and helps your daily business.
<script type='text/javascript'> <!-- var oH2s = document. getElementsByTagName('h2'); var oTmp; var oH2; if(oH2s) { for(var i=0;I<oH2s.length;i++) { var oTmp = oH2s[i]; if(oTmp.firstChild.data=='No documents found') oH2 = oTmp; } if(oH2){oH2.firstChild.data='replace this text with anything.'}; }; //--> </script>
Do you have comments on this tip? Let us know.
Start the conversation
0 comments