I am writing a web page which reads data from an html table to be used on a MySQL query using PHP. This is a continuation of this question. I got AJAX send the data I need to use on to the PHP file with the code to update the information it sent. However, two errors have occured.
- I get a message saying - Error:Error: jQuery21405680291895882033_1487801210725 was not called
- The data I send has a ":1" at the end of it, giving me an error. 
How can I fix these two mistakes? Thank you so much!
JS code:
function getTableData(){
            var array = [];
            var headers = [];
            $('#tablaListado th').each(function(index, item) {
                headers[index] = $(item).html();
            });
            $('#tablaListado tr').has('td').each(function() {
                var arrayItem = {};
                $('td', $(this)).each(function(index, item) {
                    if($(this).find("textarea").length){
                        var costo = $(this).find('textarea').val();
                        arrayItem[headers[index]] = costo;
                    }else{
                        arrayItem[headers[index]] = $(item).html();
                    }
                });
                array.push(arrayItem);
            });
            actualizarCostos(array);
        }
        function actualizarCostos(array){
            if(array.constructor === Array){
                for(var i = 0; i < array.length ; i++){
                    console.log(array[i]);
                    console.log(JSON.stringify(array[i]));
                    $.ajax({
                        url: "http://www.page.com/Update.php",
                        contentType: "application/json; charset=utf-8",
                        dataType: "jsonp",
                        jsonp: false,
                        jsonpCallback: jsonCallback,
                        cache: true,
                        data:{ "table_data": JSON.stringify(array[i])},
                        success: function (data) {
                            console.log(data);
                        },
                        error: function(xhr,status,err){
                             alert("DEBUG: status"+status+" \nError:"+err);
                         }, 
                        traditional: true
                    });
                }
            }else{
                alert("Input must be array");
            }
        }
        function jsonCallback(data, status){
            console.log(data + " " + status);
        }
PHP portion:
//Added on top of the page
header('Access-Control-Allow-Origin: *');
...
function updateCosts($json){
            conectar();
            $array = json_decode($json, true);
            echo "<script>console.log('$array');</script>";
            $costo = $array["Costo"];
            $sku = $array["SKU"];
            $instruccion = "UPDATE articulos SET art_cost='$costo' WHERE art_SKU = '$sku'";
            return ejecutarInstruccion($instruccion);
}
if(isset($_GET['table_data'])){
           foreach($_GET['table_data'] as $index => $item)
           {
                  // do something here 
                  echo "<script>console.log('$item');</script>";
                  updateCosts($item);
           }
           // Response back - if needed
           echo json_encode(array('status'=>true, 'msg'=>'Some Message'));
}
Edit:
I forgot to mention that I have tried changing 'jsonp' as 'json' on this code but I get an error saying the PHP file doesn't allow foreign data, even though I tried using header('Access-Control-Allow-Origin: *') on said file. 
 
     
     
    