Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have added a custom Google Search to a site and while the search box functions the results page is pathetically empty.

Here is the search box code:

<form action="" id="cse-search-box">
<input type="hidden" name="cx" value="017425724926122041548:jqyv4auvnls" />
<input type="hidden" name="cof" value="FORID:9" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="31" />
<input type="submit" class="submit" name="sa" value="Search" />
<script type="text/javascript" src=";lang=en"></script>

Here is the display code:

<div id="cse-search-results"></div>
<script type="text/javascript">
var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 900;
var googleSearchDomain = "";
var googleSearchPath = "/cse";
<script type="text/javascript" src=""></script>

The site:

The search results page:

I have done this on several other sites with success, but this one is just not cooperating. I would appreciate any assistance in getting this to work correctly

share|improve this question

migrated from Nov 12 '10 at 22:13

This question came from our site for professional and enthusiast programmers.

1 Answer 1

Two Three things you need to look at (one related, one two unrelated) from the FireFox error console

(javascript) Error: uncaught exception: Syntax error, unrecognized expression:

Unrelated but still worth correcting:

Warning: Unexpected end of file while searching for selector. Source File: Line: 0

... and:

(parsing) Error: The stylesheet was not loaded because its MIME type, "text/html", is not "text/css". Source File: Line: 0

Also, is there a good reason you are including jQuery and related Javascript file references in the body of your HTML document?

Update: A problem on your homepage here:

<script type="text/javascript">
  $('#breaking-news ul').newsticker();

You should wrap all jQuery calls in $(document).ready(function() { /* code */ }); to ensure the DOM is ready before you change things - otherwise you'll hit a Javascript error which may prevent other scripts from running if jQuery hasn't had a chance to initialize the $ variable.

I would wager that this is what is happening with Google Custom Search - a problem with one of your other scripts is breaking script execution before the search script can run.

You should debug your site to correct these problems - FireBug may help with this task.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.