Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

360boy

Fortgeschrittener

  • »360boy« ist der Autor dieses Themas

Beiträge: 249

Wohnort: Mexico City

Beruf: Virtual tours, Krpano coding, Graphic Design, Photographer, Panographer

  • Nachricht senden

1

Dienstag, 13. Februar 2018, 18:01

Conditional to detect an empty value attribute (attribute="")

Hello there,

Just wonder how can a "if" conditional can be used to detect the case where an attribute is empty (not null) like:

Quellcode

1
name="" fov="" width=""


Used to work with this one for single conditional but it's not working when mixed with other condition.

Quellcode

1
if(element[name].attribute == , then_action(););


AFAIK this is not the case for null attribute as in this case it's there but it just doesn't have any value.

Thanks in advance! *thumbsup*

Luis

360boy

Fortgeschrittener

  • »360boy« ist der Autor dieses Themas

Beiträge: 249

Wohnort: Mexico City

Beruf: Virtual tours, Krpano coding, Graphic Design, Photographer, Panographer

  • Nachricht senden

2

Dienstag, 13. Februar 2018, 18:33

Just found the solution myself, post it here if anybody else needs it.

Quellcode

1
if(!element[name].attribute, then_action(););


That way it can be used aside other conditionals.

Luis