user1926138
user1926138

Reputation: 1514

Custom Google Search Ajax call

I am using a Custom Google Search to get the Google content of my searched query.

its showing some error in my developer tool.That error is not effecting the result means result is showing in my UI but some error is showing.

Errors are

  1. Invalid 'X-Frame-Options' header encountered when loading 'http://www.google.com/cse?q=web%20storage%20in%20html5&client=google-coop&h…330&dt=1364365747827&u_w=1366&u_h=768&bs=1366,333&ps=1366,0&frm=0#master-1': 'ALLOWALL' is not a recognized directive. The header will be ignored.

  2. Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL http://www.google.com/cse?q=web%20storage%20in%20html5&client=google-coop&h…330&dt=1364365747827&u_w=1366&u_h=768&bs=1366,333&ps=1366,0&frm=0#master-1. Domains, protocols and ports must match.

  3. Invalid 'X-Frame-Options' header encountered when loading 'http://www.google.com/cse?q=web%20storage%20in%20html5&client=google-coop&h…earch.aspx%3Fquery%3Dweb%2520storage%2520in%2520html5%26type%3D2#slave-1-1': 'ALLOWALL' is not a recognized directive. The header will be ignored.

These three error is showing in my Developer tool.

My Code in aspx page

<script src="https://www.google.com/jsapi" type="text/javascript"></script>
<script>
    google.load('search', '1');
    // get a custom search control & keep it in cseControl
    // note: put your own custom search ID number here
    var cseControl = new google.search.CustomSearchControl('009827885688477640989:igzwimalyta');
    // open pages from search results clicks on the same page
    cseControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF);
    // when there are no matches, explain why
    cseControl.setNoResultsString("Sorry, there are no pages in this web site that match all the search terms.");
    // make the search field visible in div with ID 'cseDiv'
    cseControl.draw('divGoogleResult');

    cseControl.execute(userInput);
</script>

Why this error is showing? how to remove these errors?

Upvotes: 1

Views: 846

Answers (1)

Quentin
Quentin

Reputation: 944426

why this error is showing?

  1. Because Google's code does something non-standard
  2. Because Google's code tries to do things that are not allowed.
  3. This is the same as 1

how to remove these errors?

Short of not using Google's code (or getting a job at Google working on that service!), you can't.

Upvotes: 2

Related Questions