How to send some data to a function without loading a new page - 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: How to send some data to a function without loading a new page (/showthread.php?tid=58327) |
How to send some data to a function without loading a new page - El Forum - 06-03-2013 [eluser]ethio[/eluser] I'm trying to send a product id to a method without loading a new page, and since I do not have a sentence in the method to load another view I get a blank page. This is the from inside the product view Code: echo form_open('shopping_basket/add_to_basket/'); I have also tried using JavaScript which also loads a blank page Code: echo "<a href='' return false;'>Add to Basket</a>"; How to send some data to a function without loading a new page - El Forum - 06-05-2013 [eluser]ethio[/eluser] Code: [removed] I'm using this jquery script now and it doesn't work. Looking at the console tab in Chrome it gives this error: Uncaught TypeError: Object [object Object] has no method 'ajaxForm' EDIT: ajaxForm is not in the JQuery documents, I think it's deprecated and that's why I got that error message. I'm using the .submit function now. How to send some data to a function without loading a new page - El Forum - 06-28-2013 [eluser]niki_mihaylov[/eluser] Jquery ajax form is a plugin that helps you handle ajax calls. More info here: http://malsup.com/jquery/form/ In your case you can do something like: Code: $.ajax({ in the example i often use _ROOT as helper variable for my javascript file. I usualy set it on top of my documment like so: Code: var _root = "<?php echo site_url() ?>"; |