Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] I get <!----> from nowhere
#1

[eluser]SPeed_FANat1c[/eluser]
Hi,

simple function, but I can't find an error Sad
Here is the function which should return some result to javasc+ipt:

Code:
function get_comments_per_page_ajax()
    {
        //$this->load->model('Nustatymai_model');
        //$nust = $this->Nustatymai_model->gauti_nust();
        
        //$count = array('count' => $nust->koment_sk);
        $count = 'test';
        echo $count;
    }

and here is the javascript, which takes the data from function:

Code:
$.ajax({
        url: CI.base_url + 'details/get_comments_per_page_ajax',

        dataType: 'text',
        type: 'post',
        success: function (j) {
    
           alert(j);    
    
        }
      
      });

The function alerts '<!---->test'.
I don't understand why it adds <!----> ?
#2

[eluser]trumpetnl[/eluser]
<!——> comes from your html part, its to comment a block of html. When i have this, its usualy because of missing or to many closing tags ('?&gt;').
#3

[eluser]SPeed_FANat1c[/eluser]
Thank you, I checked &lt;?php and ?&gt; tags in my detaisl.php file and found that &lt;!-- was before &lt;?php and --&gt; was ater ?&gt;. Probably they caused a problem.

Still don't understand how could I ever add those in controller file Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB