![]() |
Ajax periodical refresh using jquery - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Ajax periodical refresh using jquery (/showthread.php?tid=12773) |
Ajax periodical refresh using jquery - El Forum - 10-30-2008 [eluser]hackersapien[/eluser] I've implemented using codeigniter and jquery, a periodic refresher that basically reloads a div every few seconds. The javascript is working well and using firebug I can see the request being sent and the response, the only problem is that the <div> in my view isn't loading the response, I'm not sure its a javascript problem since firebug has no errors so I think its a problem with the CI code. Javascript Code: function callMeOften() CI Controller Code Code: function getpic($id=null) Code: <?php if($profilepic!=""){ If you got any idea where i'm going wrong, please assist me. Ajax periodical refresh using jquery - El Forum - 10-30-2008 [eluser]Pascal Kriete[/eluser] Your jQuery selector isn't valid. Probably missing a # if you're using the div's id. Ajax periodical refresh using jquery - El Forum - 10-30-2008 [eluser]ggoforth[/eluser] [quote author="hackersapien" date="1225420921"]I've implemented using codeigniter and jquery, a periodic refresher that basically reloads a div every few seconds. The javascript is working well and using firebug I can see the request being sent and the response, the only problem is that the <div> in my view isn't loading the response, I'm not sure its a javascript problem since firebug has no errors so I think its a problem with the CI code. Javascript Code: function callMeOften() CI Controller Code Code: function getpic($id=null) Code: <?php if($profilepic!=""){ If you got any idea where i'm going wrong, please assist me.[/quote] If you are seeing the response in Firebug then there isn't anything wrong with CI. I would say it's your jQuery selector. You are selecting: $('updateMe') where I think you mean $('#updateMe') or $('.updateMe'). The selector is CSS based so you need to select the id. That selector is looking for an html tag named updateMe. Hope that helps. Greg |