谁帮我做一个百度搜索框的代码啊,万分
发布网友
发布时间:2024-04-09 17:38
我来回答
共1个回答
热心网友
时间:2024-04-09 20:12
百度网页搜索的代码
<form onsubmit="return WithHttps(this)" action="http://www.baidu.com/" target="_blank">
<input name="tn" type="hidden" value="SE_zzsearchcode_shhzc78w">
<a href="https://www.baidu.com/" target="_blank">
<img src="https://www.baidu.com/img/_jgylogo3.gif" alt="Bai" align="bottom" border="0">
</a>
<input type="text" onfocus="checkHttps" name="word" size="30">
<input type="submit"value="百度搜索">
</form>
<script src="http://s1.bdstatic.com/r/www/cache/global/js/BaiHttps_20150714_zhanzhang.js"></script>
<script>
function checkHttps () {
BaiHttps.useHttps();
};
function WithHttps (formname) {
var data = BaiHttps.useHttps();
if (data.s === 0) {
return true;
}
else {
formname.action = 'https://www.baidu.com/' + '?ssl_s=1&ssl_c' + data.ssl_code;
return true;
}
};
</script>