服务器按钮 调用 一段 JS函数 没反应,帮看看是怎么回事??
实现的功能就是在文本框中输入内容 弹出 百度的 查找页面~~
现在的问题是 点击服务器按钮一Button1 没反应??
点击按钮 二 可以调用 百度搜索 但是 如果是中文 会出现乱码??
各位兄弟帮看看~
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="10_调用Baidu.aspx.cs" Inherits="_10_调用Baidu" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script language="javascript">function search(){ window.location="http://www.baidu.com/s?wd=" + document.getElementById("key").value + "&cl=3";}function search2(){ window.location="http://www.baidu.com/s?wd=" + document.getElementById("key2").value + "&cl=3";}</script></head><body> <form id="form1" runat="server"> <div> <asp:TextBox ID="key" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="百度一下" OnClientClick="search()" /><br> <input id="key2" type="text" /> <button onclick="javascript:search2();">百度一下</button> </div> </form></body></html>