私のコードを見てください:
// is_array function
function is_array(input){ return typeof(input)=='object'&&(input instanceof Array); }
// Check if cos_in is an array. If is not, create him
if(!is_array(cos_in))
{
var cos_in = new Array();
}
// Onclick function
function cos(pret,box,configuratie)
{
// Create a value (is different on every click; using different box)
cos_in[box] = box + '|||' + pret + '|||' + configuratie + '||||';
// Insert values from array in some div with #cos id
$("#cos").html(cos_in.join('||||'));
}
私の問題は、id #cos を持つ div の開始値が「test-empty」であり、onclick 関数が実行されるたびに、div に関数からの値が必要であることです。しかし、空のdivを返します。
助けてください。