Eigentlich in meiner Funktion muss ich zwei Zeichenfolgen, die eine Zeichenfolge ich durch die db vergleichen und mit der null
Zeichenfolge vergleichen, aber es funktioniert nicht .. Hier ist mein Code:Vergleich von zwei String funktioniert nicht im Skript
order.items.forEach(function(entry) {
result += '<tr>'
+ '<td>'+'<font size=2>'+ a++ + '</font>'+ '</td>'
+ '<td>' +'<font size=2>'+ entry.title + '</font>'+ '</td>'
+ '<td>' +'<font size=2>'+ entry.quantity + '</font>'+'</td>'
if(entry.personalization == 'null') //here is the problem
+ '<td>' +'<font size=2>'+ 'No Personalization' + '</font>'+'</td>'
else
+ '<td>' +'<font size=2>'+ entry.personalization + '</font>'+'</td>'
+ '</tr>';
})
result +='</table>';
$('.modal-body').html(result);
'null' nicht' 'null'' –
vergleichen Sie es wie if (! (Entry.personalization)) – Ripun
@Ripun Was passiert, wenn 'entry.personalization' ist auf Null? Wird dein Tipp noch halten? – spender