You are not logged in.

360boy

Intermediate

  • "360boy" started this thread

Posts: 249

Location: Mexico City

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

  • Send private message

1

Tuesday, February 13th 2018, 6:01pm

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:

Source code

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


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

Source code

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

Intermediate

  • "360boy" started this thread

Posts: 249

Location: Mexico City

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

  • Send private message

2

Tuesday, February 13th 2018, 6:33pm

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

Source code

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


That way it can be used aside other conditionals.

Luis