1//do the edit in your javascript
2
3$('.signinform').submit(function() {
4 $(this).ajaxSubmit({
5 type : "POST",
6 //set the data type
7 dataType:'json',
8 url: 'index.php/user/signin', // target element(s) to be updated with server response
9 cache : false,
10 //check this in Firefox browser
11 success : function(response){ console.log(response); alert(response)},
12 error: onFailRegistered
13 });
14 return false;
15});
16
17
18//controller function
19
20public function signin() {
21 $arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5);
22
23 //add the header here
24 header('Content-Type: application/json');
25 echo json_encode( $arr );
26}
27