skip to Main Content

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

Php versions – Convert array variables to associative array

In PHP, what is quickest way to turn the following array variables: $id = [11,12,13]; $code = ['1234','5678','9012']; $qty = [3,4,5]; $amount = [12.34,23.45,34.56]; Into an array of associative arrays, like the following: [ ['id'=>11,'code'=>'1234','qty'=>3,'amount'=>12.34], ['id'=>12,'code'=>'5678','qty'=>4,'amount'=>23.45], ['id'=>13,'code'=>'9012','qty'=>5,'amount'=>34.56], ] Currently, I'm…

VIEW QUESTION
Back To Top
Search