日期:2014-05-16  浏览次数:20378 次

为什么我的网页中嵌入百度搜索窗口会出现乱码?
我在我的网页中加入了http://www.baidu.com/search/freecode.html中的代码,但是我选择搜索“新闻”那个就会出现搜索乱码,是不是编码的问题,应该怎么解决,下面是我的源代码





<!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>
  <title>Untitled Page</title>
  <meta charset="gbk">
</head>
<body>

<SCRIPT language=javascript>
  function gowhere1(formname) {
  var url;
  if (formname.myselectvalue.value == "0") {
  url = "http://www.baidu.com/baidu";
  document.search_form1.tn.value = "baidu";
  formname.method = "get";
  }
  if (formname.myselectvalue.value == "1") {
  url = "http://mp3.baidu.com/m";
  document.search_form1.tn.value = "baidump3";
  document.search_form1.ct.value = "134217728";
  document.search_form1.lm.value = "-1";
  }

  if (formname.myselectvalue.value == "4") {
  document.search_form1.tn.value = "news";
  document.search_form1.cl.value = "2";
  document.search_form1.rn.value = "20";
  url = "http://news.baidu.com/ns";
  }
  if (formname.myselectvalue.value == "5") {
  document.search_form1.tn.value = "baiduiamge";
  document.search_form1.ct.value = "201326592";
  document.search_form1.cl.value = "2";
  document.search_form1.lm.value = "-1";
  url = "http://image.baidu.com/i";
  }
  if (formname.myselectvalue.value == "6") {
  url = "http://post.baidu.com/f";
  document.search_form1.tn.value = "baiduPostSearch";
  document.search_form1.ct.value = "352321536";
  document.search_form1.rn.value = "10";
  document.search_form1.lm.value = "65536";
  }

  formname.action = url;
  return true;
  }
</SCRIPT>
<form name="search_form1" target="_blank" onsubmit="return gowhere1(this)">
<table width="460" height="60" border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" style=font-family:宋体><tr><td>
<TABLE width="460" height="80" border=0 cellPadding=0 cellSpacing=0>
  <INPUT name=myselectvalue type=hidden value=0>
  <INPUT name=tn type=hidden>
  <INPUT name=ct type=hidden>
  <INPUT name=lm type=hidden>
  <INPUT name=cl type=hidden>
  <INPUT name=rn type=hidden>
  <TR>
  <TD width="8%" valign="bottom">
  <DIV align=center><a href="http://www.baidu.com/"><img src="http://img.baidu.com/img/logo-80px.gif"
alt="Baidu" align="bottom" border="0"></a></DIV></TD>
  <TD vAlign=bottom width="92%">
<INPUT name=myse