Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在url中添加搜索关键字后如何触发google自定义搜索?_Javascript_Jquery_Url_Search_Google Custom Search - Fatal编程技术网

Javascript 在url中添加搜索关键字后如何触发google自定义搜索?

Javascript 在url中添加搜索关键字后如何触发google自定义搜索?,javascript,jquery,url,search,google-custom-search,Javascript,Jquery,Url,Search,Google Custom Search,我正在使用谷歌自定义搜索,它工作正常。现在在搜索时在url中添加搜索关键字。 现在,当复制并粘贴这个附加的url到新标签页时,搜索不起作用。如何使用附加的搜索关键字触发google自定义搜索 (功能(){ 变量cx='01472566687841406486:r_hyheflpag'; var gcse=document.createElement('script'); gcse.type='text/javascript'; gcse.async=true; gcse.src=https:

我正在使用谷歌自定义搜索,它工作正常。现在在搜索时在url中添加搜索关键字。 现在,当复制并粘贴这个附加的url到新标签页时,搜索不起作用。如何使用附加的搜索关键字触发google自定义搜索


(功能(){
变量cx='01472566687841406486:r_hyheflpag';
var gcse=document.createElement('script');
gcse.type='text/javascript';
gcse.async=true;
gcse.src=https://cse.google.com/cse.js?cx=“+cx;
var s=document.getElementsByTagName('script')[0];
s、 parentNode.insertBefore(gcse,s);

})();在这种情况下,您是否可以使用搜索元素回调?