$.jQuery.load() Partial HTML - 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: $.jQuery.load() Partial HTML (/showthread.php?tid=24308) |
$.jQuery.load() Partial HTML - El Forum - 11-05-2009 [eluser]Unknown[/eluser] Hi, I'm trying to load partial HTML into the main HTML using Jquery $.load(<url>, <data>, <callback>). I realised a problem in linking to the partial HTML if I put the partial HTML inside the view. Any idea how can I keep the structure (shown below) of having my partial views inside the View folder and still able to use the $.load(<url>); application +-views +-backend +-partial | +-contact_form.php +-index.php +-contact.php Does modifying the route helps? Cheers, Mickey $.jQuery.load() Partial HTML - El Forum - 11-05-2009 [eluser]clip[/eluser] Code: $partial = $this->load->view('partial/myview', $data, TRUE); Point to your controller/method maybe its something like post/ajaxview/3 You could also create a function that checks to see if the request url is ajax and build that logic into your controller to avoid creating one specificaly for ajax requests. |