jQuery Javascript loading continuously in CodeIgniter

sammy1jackson12

New Member
I am developing one application using PHP, jQuery, Javascript in CodeIgniter. I included script.js file in view file. The problem is the view file is continuously loading again and again with in the result div called "new".Please help me. Below are the files and code.View file\[code\]<?php $this->load->view('header'); ?> <script type="text/javascript" src="http://stackoverflow.com/questions/3898782/<?php echo base_url();?>js/script.js"></script><div id="content"> <div id="news"></div></div>\[/code\]\[code\]script.js\[/code\] has the following code:\[code\]$.post('news/getnews', function(data) { $('#news').append(data);});\[/code\]In controller, \[code\]function getnews(){ echo some data.}\[/code\]It only loading the result again and again when I use Post, ajax etc methods. i.e, when I try to get data from controller and append to view using Javascript.Thanks,Raj
 
Back
Top