帮忙找下错,这是什么情况,怎么解决

a734998102 2014-08-28 03:50:39
js:
$(document).ready(function(){
function yesShow(){
url = '/index.php/home/Index/showNews' + '/univ_name/'+univ_name;
htmlobj = $.ajax({
type:"POST",
url : url,
async : false
});

alert(htmlobj.responseText);
$("#popNew").html(htmlobj.responseText);
}
window.onload=yesShow;
});


php:
public function showNews($univ_name){
$univ_name=$_GET['univ_name'];
$url = "http://www.sogou.com/web?query=".$univ_name."&ie=utf8";
$contents = file_get_contents($url);
//汉语输出
echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>";
//起始字符位置
$start_ch=strpos($contents,'<ul class="str-ul-list new-ul-list">');
//结束字符为止
$end_ch=strpos($contents,'</ul>',$start_ch)+5;
//新闻相关字符串
$new_str=substr($contents, $start_ch,$end_ch-$start_ch+1);
if ($new_str&&$contents&&$start_ch&&$end_ch){
echo $new_str."<br/>";
}
else echo "<center>"."没有搜到相关新闻"."</center>";
}


谷歌 ff都显示新闻,但是ie不显示,而且alert(htmlobj.responseText);都不跳出来
...全文
84 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

4,251

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧