关于在6miu Blog公告栏加入Google搜索功能的问题

xiaoxiao2021-03-01  22

网友summerfang反映不能在Blog公告栏加入Google搜索代码。

经查证,该问题是asp.net的server端form导致的,解决此问题请使用如下代码:

<div style="text-align: left;">

<script type="text/javascript">function searchGoogle(key,evt,site){if(evt.keyCode==13 || evt.keyCode==0 || evt.type =='click'){key.focus();var keystr = key.value;url = "http://www.google.com/search?q=";url = url + keystr;url += "&ie=UTF-8&oe=GB2312&hl=zh-CN&domains="+site+"&sitesearch="+site;window.location=url;return false;}}</script>

<input style="width: 130px" type="text" name="q" id="q" οnkeydοwn="return SearchGoogle(document.getElementById('q'),event,'blog.csdn.net')" /> 

<input οnclick="searchGoogle(document.getElementById('q'),event,'blog.csdn.net')" type="button" value="搜索" name="sa" /></div>

在您Blog中的呈现样式请自行调整。

相关资源:微信小程序源码-合集1.rar
转载请注明原文地址: https://www.6miu.com/read-3450335.html

最新回复(0)