I am using codeigniter in my application and have a jquery post function that works perfectly.
$.post('getticketstacktype', {ticketnumber:ticketnumber},function(result) {
alert(result);
}
I am then using the exact same post function on another edit page. this page is prepopulated with PHP and works correctly.
I use the same post to call my controller, I have checked that ticketnumber value is correct
$.post('getticketstacktype', {ticketnumber:ticketnumber},function(result) {
alert(result);
}
the controller function it calls is:
function getticketstacktype(){
if (isset($_POST['ticketnumber'])){
$ticketnumber = $_POST['ticketnumber'];
$data = $this->wos_model->getticketstacktype($ticketnumber);
$this->output->set_content_type('application/json')->set_output(json_encode($data));
}
}
now where this works correctly the result is '7' but instead, on my edit page it is returning my entire view page rendered:
so <html><head>......</html> hundereds of lines)
I cant figure out my why my entire page is being returned as a result to a jquery post when it is working in another view.
I have also verified that the post information from both views is the same with firebug.
Any advice? Thanks as always.