This is my first function, i pass to json end if it is the first time i save the json is original.
function loadchart2(div, json, lista,tipo) {
var listaId = lista;
if(l==0){
jsonSecCall =JSON.parse(JSON.stringify(json));
listaSecCall=listaId;
l++;
}
I modify json ,and click a button. Call second function and call loadcart2 and pass the json original but actually receives the json modify, What???
$("#giorni").on('click',function () { var nuova=jsonSecCall;
$("#svgDateLine2").remove();
loadchart2("content", nuova,listaSecCall,"giorni");
checkContainer();
});
Probably the json it is gone for reference, is possible??
This is an example https://jsfiddle.net/tsjvmsd0/. First console log print json modified, is ok, the next console log they should print the original json, but print json modified.