jquery-1.10.2.js:8706 POST 500 (Internal Server Error)

Saya mempunyai script seperti berikut ini

script.jpglalu controller seperti berikut:

controller.jpgdan modelnya seperti berikut

model.jpgtapi datanya ngga muncul dan malah jadi error seperti ini

error1.jpgkepada agan2 ada yg tau solusinya gmna???

avatar opikgandring85
@opikgandring85

30 Kontribusi 1 Poin

Dipost 3 tahun yang lalu

Tanggapan

coba lampirkan kode aslinya, jangan screenshoot, biar gampang copas nya

siap gan ini dibawah ini gan

1 Jawaban:

<div>modelnya<br>public function getJdwlAwlAkhr($idjad)</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return $this-&gt;db-&gt;get_where('jadwaluji', ['id' =&gt; $idjad])-&gt;result();</div><div>&nbsp; &nbsp; }<br><br>controllrny<br>public function getTGL_awal_akhir()</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $idjad = $this-&gt;input-&gt;post('id');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $data = $this-&gt;Jadwal_model-&gt;getJdwlAwlAkhr($idjad);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;output-&gt;set_content_type('application/json')-&gt;set_output(json_encode($data));</div><div>&nbsp; &nbsp; }<br><br>scriptnya<br>&lt;script&gt;</div><div>&nbsp; &nbsp; jQuery(document).ready(function(<em>$</em>) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $('#penyelenggara').change(function() {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var id = $(this).val();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <em>// console.log(id);</em></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $.ajax({</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type: "POST",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url: "&lt;?= base_url('jadwal/getTGL_awal_akhir'); ?&gt;",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data: {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; id: id</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dataType: "JSON",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; success: function(<em>response</em>) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(response);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</div><div>&nbsp; &nbsp; &nbsp; &nbsp; });</div><div>&nbsp; &nbsp; });</div><div>&lt;/script&gt;</div>

avatar opikgandring85
@opikgandring85

30 Kontribusi 1 Poin

Dipost 3 tahun yang lalu

Tanggapan

taruh di tag code atuh biar gampang bacanya

Login untuk ikut Jawaban