loading controller via 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: loading controller via jquery (/showthread.php?tid=49521) |
loading controller via jquery - El Forum - 02-23-2012 [eluser]Paleleaves[/eluser] Hi, My issues is with jquery and codeigniter. That's why posted here... I've an image delete confirmation dialog box in jquery, that is below. Receiving ID of the image to be deleted in var myid. Please see the full code below! Code: [removed] Please see the commented area in code where i need to call the controller. I tried jquery $.post() method but didn't workout. Also another problem is setting the site base_url(); inside the javascript. Any help for this really helpful. Thanks in advance loading controller via jquery - El Forum - 02-23-2012 [eluser]aquary[/eluser] uh.... was typing a very long comment and accidentally hit something on keyboard.... making everything disappear... k, in short... you can pull the URL directly from the trigger elements... Code: // PHP/HTML You could also define the base_url in javascript, but it's not 100% bullet proof with out some manual editting. Code: var base_url=wind0w.l0cation.hostname; // change 0 to o Then about the action part, non AJAX wise, you may return TRUE/FALSE for Yes/No accordingly to continue the click event or stop it. and about the $.post which you said not working... maybe it was about the URL which is not a good one, but with the above method, you'll always get a good one.... I suggest you to check what are the URL called in the Firebug/Chrome console, to see If it's a good URL or with some errors, either in PHP or JS. grr... getting headache by typing the same stuff 2 times .-. loading controller via jquery - El Forum - 02-23-2012 [eluser]Paleleaves[/eluser] @aquary Thank you very much for your patience to sent such a detailed comment. My issue is resolved now.. Thanks again for you .. cheers |