刚学jquery,试了一个例子,有两个页面index.html,data.php,但每次执行都显示的都是乱码,请问该怎么办?
index.html
nbsp;html public -//w3c//dtd html 4.01 transitional//en http://www.w3.org/tr/html4/loose.dtd>
new document
show list of:
select
good guye
bad guye
data.php
if($_get['what']=='good')
{
$names=array('sherlock helmes','john watson','hercule poirot','jane marple');
echo gethtml($names);
}
else if($_get['what']=='bad')
{
$names=array('professor moriarty','sebastian moran','charles milverton','von bork','count sylvius');
echo gethtml($names);
}
function gethtml($names)
{
$strresult='';
for($i=0;$i {
$strresult.=''.$names[$i].'';
}
$strresult.='';
return $strresult;
}
?> 分享到:
