TypeAdhead JS holt ungültige JSON -Daten auf dem Live -Server abPhp

PHP-Programmierer chatten hier
Anonymous
 TypeAdhead JS holt ungültige JSON -Daten auf dem Live -Server ab

Post by Anonymous »

Ich habe in meinem Codesigniter 3 -Projekt eine TypeAhe -Stunde verwendet und es hat bei Localhost gut funktioniert, aber als ich es auf Live -Server ausgeführt habe, ist es fehlgeschlagen. Ich kann es nicht beheben, sodass Hilfe erforderlich ist.

Code: Select all


< /code>
Mein JS -Code ist < /p>
$("#refby").typeahead({
source:  function (query, process) {
return $.get("", { query: query }, function (data) {
console.log(data);
data = $.parseJSON(data);
return process(data);
});
}
});
< /code>
Controller -Funktion ist < /p>
public function get_doctor()
{
$check = $this->input->post('check');
$data = $this->customers->get_doctor($check);
echo json_encode( $data);
}
< /code>
Modellfunktion ist < /p>
function get_doctor($check)
{
print_r($check);
$this->db->select('name');
$this->db->like('name', $check);
$this->db->from('doctors');
$query = $this->db->get();
return $query->result();
}
< /code>
Skriptlink ist < /p>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post