• Publisert
  • 1 min

Google Custom Search Iframe problem

<p>After having spent a bit og time trying to figure out why IFrame-based Google custom Search didn't display properly, I finally found the solution. And ohh so simple it can be sometimes....</p>

The problem in question was that the search result displayed in full screen, instead of inside the IFrame, as supposed.

The solution was as simple as adding the following line (bold below) in the results part of the code:

<script type="text/javascript">
        var googleSearchIframeName = "cse-search-results";
        var googleSearchFormName = "cse-search-box";
        var googleSearchFrameWidth = 100;
        var googleSearchDomain = "www.google.com";
        var googleSearchPath = "/cse";
        var googleSearchResizeIframe = false;

If you struggle with the same problem, give it a try. It worked for me.