Last post Nov 02, 2016 08:33 PM by PatriceSc
Nov 02, 2016 10:35 AM|RateFor|LINK
Google lets you put in a custom search into your website for free. The URL that explains their code is at: https://developers.google.com/custom-search/docs/element
But there is a problem. Even though the code works in production, when I used it in Visual Studio on my development PC, I get an error.
The code they supply is:
var cx = '123:456'; // Insert your own Custom Search engine ID here
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script'); s.parentNode.insertBefore(gcse, s);
<!-- Place this tag where you want both of the search box and the search results to render -->
and the error I get is:
SCRIPT5022: Syntax error, unrecognized expression: unsupported pseudo: search
I could probably turn off the 'browserlink' feature of Visual Studio, but why is this happening? Is Google at fault?
Nov 02, 2016 08:33 PM|PatriceSc|LINK
This is shown by Visual studio? More likely the issue shows an error because VS check the document for valid markup and doesn't know about this custom tag. It seems Google allows also to do thes same thing using for example :
(scroll down the documentation to "HTML5-valid