skip to Main Content

How to add Ajax response to div in html – Jquery ajax

How to append Ajax response to div in HTML This is my ajax Code $(document).ready(function(){ $('.credit,.debit').change(function(){ var value=$(this).val(); $.ajax({ type:"POST", url:"<?php echo base_url();>index.php/Transactions/getamountbyid", data:{id:value}, success:function(result){ console.log(result); $(".bal").html(result); } }); }); }); This is my controller Code public function getamountbyid(){ $id=$this->input->post('id');…

VIEW QUESTION

Nested JSON data via AJAX with jquery but getting undefined value – Jquery ajax

Javascript JSON Web Inspect I have got an error message. Uncaught ReferenceError: products is not defined. $(document).ready(function(){ $("div").on("click", "a", function(){ var delivery_id = $(this).attr("id"); $.ajax({ url:"http://localhost:8888/dashboard/fetch_edit.php", method:"POST", data:{products:products},} }); }); JSON { "id": "2", "send_id": "10", "tracking_id": "TI-000000010", "user_id": "10",…

VIEW QUESTION

i want to insert data into database directly from a table (view) but when i click add btn only the first or the last row get insterted – Jquery ajax

here in this code i have passed the hardcoded value of month if i remove january it accepts december i.e last row how to solve this issue controller public function storeLeave(Request $request){ $admin= new Admin(); $admin->employee_name=$request->input('employee_name'); $admin->month=$request->input('month_JANUARY'); $admin->earned_leave=$request->input('earned_leave_JANUARY'); $admin->casual_leave=$request->input('casual_leave_JANUARY'); $admin->sick_leave=$request->input('sick_leave_JANUARY');…

VIEW QUESTION
Back To Top
Search