RE: Google Searchbox Not Validating as HTML5
Mark Rogers <[email protected]> Wed, 1 Jul 2015 11:35:38 -0500
| Newsgroups | gmane.org.w3c.validator |
|---|---|
| Message-ID | <1F68EA0E0CBFBE44A9A64274E1AC01A12A00B1F330@DFW1MBX23.mex07a.mlsrvr.com> |
The custom tag doesn't validate since it's not part of HTML5. Google have some instructions for replacing the custom tag with HTML5 valid code here: https://developers.google.com/custom-search/docs/element#html5 Best Regards Mark Mark Rogers - [email protected] PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL -----Original Message----- From: Julian P [mailto:[email protected]] Sent: 01 July 2015 00:22 To: [email protected] Subject: Google Searchbox Not Validating as HTML5 Hi! I have added the Google searchbox to my HTML5 site. When I go to the W3C validator I get an error: 'element gcse:search not allowed as child of element div in this context'. I was instructed by Google to put the script in a div, and cannot get the searchbox to work without it. My code is below. Many thanks! Julian <div id="searchbox"> <script> (function() { var cx = '014531685129972083622:vk5kxnojpx0'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); </script> <gcse:search> </gcse:search> </div>