Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

197
Visualizações
How to use an if or condition statement to hide/not display href link and text from .json file using javascript

I'm working on a site which pulls information from a .json file when a location on a map is selected to populate information in a content template, one of these fields contains URLs to real estate virtual walkthroughs, though not all of the properties in the .json file have Virtual Walkthrough URLs in their respective fields.

Currently the site uses:

HTML:

<li><span style="color: #0000ff;"><a href={VirtualLink} target="_blank" rel=”noopener noreferrer” style="color: #0000ff;">Real Estate Walkthrough</a></span></li>

This works fine for the properties that have a URL listed in the .json file against the property ID, however if the field is empty the link text still displays, and the link won't work as there is no URL in the .json field for the specific property.

I want to be able to use javascript in a similar manner to the Excel IF(condition, value_if_true, value_if_false), to display the text "Real Estate Walkthrough" and href link if the .json field contains a URL for the property ID selected and if the .json field is empty then to display nothing.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda