从PHP代码获取警告空?

时间:2011-10-09 20:10:12

标签: php javascript jquery codeigniter

我不知道为什么在以下js代码警报是空的没有html代码,我的视图有html代码,my_class对其他控制器工作为真,当我得到警报这意味着它是工作正确的js代码但获取PHP代码的数据没有HTML。我该怎么办?

function guide_show($offset = 0) {
$find = $this -> input -> post('find');
$where = "name LIKE '%$find%' OR phone LIKE '%$find%' OR mobile LIKE '%$find%' OR address LIKE '%$find%' OR date_submit LIKE '%$find%' OR useradmin_submit LIKE '%$find%'";
$table = "guide";
$url_pag = "admin/submits/guide_show";
$order = "id";
$data = $this -> my_class -> show($where, $table, $url_pag, $order, $offset);
    $this->load->view('admin/guide_show', $data);
}

jQuery的:

$.ajax({
    type: "POST",
    dataType: "html",
    url: url,
    data: dataString,
    cache: false,
    success: function (html) {
        alert(html)
    },
    "error": function (x, y, z) {
        // callback to run if an error occurs
        alert("An error has occured:\n" + x + "\n" + y + "\n" + z);
    }
})

这是My_class(库):http://pastebin.com/6DxjmBFC

以下是我在视图中的htm代码(guide_show):http://pastebin.com/mtubjzvB

1 个答案:

答案 0 :(得分:0)

检查Firebuq - > NET [展开]并显示响应正文