How to fetch array value using ajax and php

public function getdoctordate()
	{

  		 $row = $this->my_model->getdocdate();
	
	echo json_encode($row);exit;
	
	}
$("#doctor").change(function(value)
		{
			
			var hopid=$("#hospital").val();
			var docid=$("#doctor").val();
	//		alert(hopid);
			
			$.ajax({
				type: "POST",
				url: "<?php echo site_url(); ?>doctor/referral/getdoctordate",
				data: {'hosid' : hopid,'docid':docid},
				dataType: "json",
				success: function(msg)
				{
			         alert(msg);
				    alert(msg.date[0]);
				 ("#docleave").val(msg);
				
				}
			});
		}

AJAX can only request a script, not a single function.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.