Skip to content
Advertisement

Hide the tables until the response is sent

I have a problem, make a small script to track packets over the Internet.

It works properly, the problem is that before the client sends its guide number the tables are already displayed (empty) and once the guide is put on, the data that pulls from the API already appears.

Is there a way that as long as the send button is not pressed and there is a response the tables will not be seen?

I want them to only appear when you already have data to display.

The code of the site is this:

JavaScript

Previously I handled it with a separate file so that the api query was made but it showed me a blank page with only the table and it looked very ugly I want it to be seen on the same page that the client puts his guide only below and this was what I came up with only that I did not think that the table would be displayed at all times.

Advertisement

Answer

A simple if statement to check if the POST is set — Then build your table out… :

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement