php - Ajax Call not returning successful but script executes -
i have ajax call made using custom callback function invoked redactor.js - ajax itsself posts data function stores information in database. know post being made , script executing because information itsself being stored correctly .success function of ajax call not completing , cannot life of me figure out why.
my call in full below. 'data' not logged in console , have attempted manner of alerts etc
$.ajax ({ url:'<?php echo base_url('cms/page/'.$this->type.'/create/'.$this->page_id); ?>', type:'post', datatype: 'json', data: 'content=' + $('#redactor').redactor('get')+'&status=draft&title='+ $('#title').val() +'&sub=' + $('#sub').val()+'&id=<?php echo $this->page_id;?>&tags='+$('#tags').val()+'&dynamic_save=true&post_page=true', cache: false }).success(function ( data ) { console.log( data ); });
i think need test code working me
var config = { url: your_url, type: 'post', data: {"key1" : "val1","key2" : "val2"}, // headers: headers(optional), datatype : 'json' success: function(data){ console.log(data); // handle success response } }; $.ajax(config);
or can use .done method intead of .success see this
Comments
Post a Comment