• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
404 how make a rote

#1
I send ajax to server
 $.ajax({
          type: 'POST',
          dataType:'json',
          url: '/functions_ajax/check_all_Ukraine',

There is a server side
class Functions_ajax extends CI_Controller {

public function __construct()
     {
    parent:: __construct();
    $this->load->helper('url');
    require('server/FirePHP.class.php');
    $this->load->model('cities_model');
    $firephp = FirePHP::getInstance(true);
    $firephp -> fb("hello world! i'm warning you!",FirePHP::WARN);
    }
    
    public function check_all_Ukraine(){
    $data=$this->cities_model->get();
    if($data){
        echo json_encode($data);
        }
        else{
        echo json_encode(NULL);
        }
    }

}



And this is A route
$route['functions_ajax/check_all_Ukraine'] = 'functions_ajax/check_all_Ukraine';

But I still have 404 error
Reply

#2
Use this for the url:
PHP Code:
url'<?php echo site_url();?>functions_ajax/check_all_Ukraine'
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.