Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

plexcetre

Newbie
  
  • Posts

    1
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

plexcetre's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter

Recent Badges

0

Reputation

  1. При вызове функции из контроллера, путем отправки post запроса в методе error возвращает 404 not found, причем сама страница из которой идет запрос и контроллер работают. Ниже код Контроллера и самого jquery скрипта: Контроллер: <?php class ControllerCardsCards extends Controller { public function index() { $this->document->setTitle($this->config->get('config_meta_title')); $this->document->setDescription($this->config->get('config_meta_description')); $this->document->setKeywords($this->config->get('config_meta_keyword')); if (isset($this->request->get['route'])) { $this->document->addLink($this->config->get('config_url'), 'canonical'); } $data['column_left'] = $this->load->controller('common/column_left'); $data['column_right'] = $this->load->controller('common/column_right'); $data['content_top'] = $this->load->controller('common/content_top'); $data['content_bottom'] = $this->load->controller('common/content_bottom'); $data['footer'] = $this->load->controller('common/footer'); $data['header'] = $this->load->controller('common/header'); $this->response->setOutput($this->load->view('cards/registraion', $data)); $this->load->model('cards/cards'); $this->log->write('Controller main'); } public function addcardquery($data){ $this->log->write('fired addCardQuery function'); $this->load->Model('cards/cards'); $this->load->language('cards/cards'); $temp = $this->model_cards_cards->insertCard($data); } Jquery: $(document).ready(function(){ $("#regCardSubmit").click(function(event) { event.preventDefault(); var myObject = new Object(); myObject.lastname = $('#card_reg_lastname').val(); myObject.firstname = $('#card_reg_firstname').val(); myObject.middlename = $('#card_reg_middlename').val(); myObject.cardnum = $('#card_reg_card_num').val(); myObject.birthday = $('#card_reg_birthday').val(); myObject.phone = $('#card_reg_phone_num').val(); myObject.email = $('#card_reg_email').val(); var data = {"action": "addcardquery"}; data = $(this).serialize() + "&" + $.param(data); var outjson = JSON.stringify(myObject); //alert(outjson); $.ajax({ type: "post", dataType: "json", url: "index.php?route=cards/cards/addcardquery", data: outjson, success: function(data) { alert(outjson); }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); return false; }); }); PS используется сторонняя тема, которая лежит по пути themeXXX/.. так же тема default не удалена, скрипты расположены как раз в themeXXX
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.