Solution for JavaScript Error on Search Results Page in SharePoint

One of my clients reported that they have started getting “Object Expected” javascript error whenever they click on any link in Search Results of SharePoint. This was quite odd as the search results page was the out of the box search result page without any customization (…well up till now 😉 )…

After investigating the issue, I found out that client had deleted the “Search Box” web part from the search results page as they don’t want user to search again from the results page and you know what? “Object expected” error started popping up as soon as client removed the “Search Box” web part.

The reason is as follows:

  1. SharePoint records the user clicks on search results link.
  2. Recording of clicks utilizes a JavaScript function called “ persuasive essays on embryonic stem cell research valerian abilify follow famvir with no poscription doxycycline orange juice kak zakazat viagra post bacc essays certified registered nurse anthesis cialis boligee go source link crestor 20mg vs zocor essay on corruption the cancer of our society source link latin american essay writ my paper write my paper kratom and zithromax emily dickinson poetry essay odd creative writing prompts cialis livraison expresse an essay on christmas celebration prescription viagra from canada motilium tabletten finding essay topics source SendSoap” to asynchronously record the click.
  3. SendSoap function is defined in Search.js file located at /_layouts/ 1033 folder.
  4. Search Box web part includes this file on search results page.
  5. Search Core Results web part assumes that Search.js file will always be available and attaches the call to SendSoap on Search Result links.
  6. Deleting the Search Box web part will remove the reference to Search.js and as a result you will start getting the Object expected error whenever you click any link on results page.


  1. If you really don’t want Search Box web part on your search result page then mark it hidden instead of deleting it. In this way, you will have the reference of Search.js in your search page.   OR
  2. Include the reference to Search.js manually either by CEWP or any other means, you feel appropriate.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap