Jump to content

Is it possible to retrieve data from controller with ajax in php mvc?


darksniperx

Recommended Posts

my ajax function:

function getGroupDataWithAjax(){
$(document).ready(function() {
  		var data = $.ajax({
  		url: "groupData.php",
  		async: false
		}).responseText;
	return data;
});
}

 

function in my controller:

function getGroupData(){
	$groupData = $this->HomeModel->returnGroups();
	return	$groupData;
}

 

what i would like to do, is to call groupData.php with ajax, and store in a variable for later use.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.