[NFBCS] no display in old browser

Peter Mark usapetermark at gmail.com
Fri Apr 5 10:53:15 UTC 2024


hi list


i have a nasa picture of the day web page.
www.onisland.com/apod
it works just fine on my mac and phone, but i noticed that if i use a very old lynx browser, no text inside the <div> is displayed.
it is all just basic html and java script so i am puzzled why.
any advice would be helpful.
below is relevant snippets.

here is the style definitions and html that defines the placeholders for the retrieved data.

    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
            color: #333;
            max-width: 800px;
            margin: auto;
            padding: 20px;
        }
        h1, h3 {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        a {
            color: #007bff;
            text-decoration: none;
        }
        a:hover {
            text-decoration: underline;
        }
        #nasa-content {
            border: 1px solid #ddd;
            background-color: #fff;
            padding: 20px;
            margin-top: 20px;
        }
        #nasa-image {
            max-width: 100%;
            height: auto;
            border: 1px solid #ccc;
            padding: 10px;
            background: #fff;
        }
    </style>
...

    <div id="nasa-content">
        <p id="nasa-title"></p>
        <img id="nasa-image" src="" alt="NASA Picture of the Day">
        <p id="nasa-explanation"></p>
        <p id="nasa-copyright"></p>

    </div>

and below is the java script that fills in the html
all is pretty straight forward.

                if(data.media_type === 'image') {
                    document.getElementById('nasa-image').src = data.url;
                    document.getElementById('nasa-title').textContent = data.title;
                    document.getElementById('nasa-explanation').textContent = data.explanation;
                    if(data.copyright) {
                        document.getElementById('nasa-copyright').textContent = "Copyright "+data.copyright;
                    }
                } else {




More information about the NFBCS mailing list