Guten Morgen,
mittels OnClick="plus(17);" wird die Funktion Plus aufgerufen.
function plus(add)
{
var addthis = add;
update_price();
}
Wie man sieht wird anschließend die Funktion update_price() aufgerufen, in welcher nun die Anweisung steht, wenn Variable addthis existiert mach mir das...
also
function update_price()
{
if (typeof addthis == 'undefined')
{
alert('variable existiert nicht');
}
else {
alert('variable existiert');
}
}
Im Endeffekt kommt aber trotzdem jedes mal dass die Variable nicht existiert.
Was mache ich falsch?
Grüße MJ