sách gpt4 ai đã đi

google-oauth - 带有 Google 自定义搜索功能的 Google 附加链接搜索框

In lại 作者:行者123 更新时间:2023-12-04 15:43:24 30 4
mua khóa gpt4 Nike

我们想使用 Google 自定义搜索实现 Google 附加链接搜索框。在谷歌 tài liệu , 我发现我们需要包含以下代码来启用附加链接搜索框

    

但是我们被困在上述属性中的“目标”节点上。由于我们没有任何自己的搜索页面,我们想使用谷歌自定义搜索,那么这个“目标”节点应该填什么值。

我们已经为我们的网站创建了一个 Google 自定义搜索引擎。并在那里找到以下代码

(chức năng() {
var cx = 'CX_ID';
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);
})();



我们想要实现像 Mashable 这样的附加链接搜索框, Imdb

nhập mô tả hình ảnh ở đây

请建议,如何在附加链接搜索框代码中指向 Google 自定义搜索。

Cảm ơn

1 Câu trả lời

唯一的解决办法:

为此,您需要在自己的网站上有一个搜索页面。

For the "target" parameter, do a search on your site and take that URL and replace the search term you used to do the search with "{search_term_string}"



如果您在自己的网站上创建了一个使用自定义 Google 搜索的搜索页面,您应该能够获取该链接以获取 target -属性(property)。

原因是谷歌没有提供搜索功能

will send the user directly to your website's own search pages.



资料来源:
  • http://googlewebmastercentral.blogspot.ro/2014/09/improved-sitelinks-search-box.html
  • http://www.seocandy.co.uk/seo/setup-google-sitelink-search/
  • 关于google-oauth - 带有 Google 自定义搜索功能的 Google 附加链接搜索框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28808763/

    30 4 0
    行者123
    Hồ sơ cá nhân

    Tôi là một lập trình viên xuất sắc, rất giỏi!

    Nhận phiếu giảm giá Didi Taxi miễn phí
    Mã giảm giá Didi Taxi
    Giấy chứng nhận ICP Bắc Kinh số 000000
    Hợp tác quảng cáo: 1813099741@qq.com 6ren.com