Tip

Return Search Results on the Web Without Ugly Relevancy Boxes

As all of you may know about the little relevancy boxes that are displayed to the left of the search results. These are fairly ugly, and have been rumored to be optional in the next release, but have no easy way, now, to get rid of them. I've came up with a way of doing it combining JavaScript and Notes functionality.

First, you must have a $$Search template form created for the results. At the top of the form place the code <input type=hidden name=results value='***'>. For the value of the hidden HTML field, (***), place the $$ViewBody notes field. You must use single quotes around the field. This gets all of the results into a field that JavaScript can see and use.

Second, in the JS header, place the following code;

function results()
{
res=document.forms[0].results.value
var done="No";
list="";
i=0;

while (done!="Yes"){
begin=res.indexOf(' end=res.indexOf('>',begin)
if(begin==-1)begin=res.length
list+=res.substring(i,begin)
i=end+1
if(begin==res.length)break;
}
document.write(list)}

This runs through the HTML that displays the results and removes the image tags that display the little boxes. You can place this code anywhere on your form, as long as it is inclosed in <script language="javascript">...</script>.

Third, on the spot on your form where you want to display the results, place the call to the JavaScript function:

<script language="javascript">
results()
</script>

This was first published in November 2000

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.