Cant display images in electron app


#1

I’m having problem with displaying images in my electron app. I would like to display all images in upload folder. Upload folder is in static public folder. Upload is made with Multer.

<head>
    <meta charset="UTF-8">
    <title>Galerija</title>

    <script>
        window.$ = window.jQuery = require('./js/jquery-2.1.4.min.js');
    </script>

</head>

<body>
    <div class="navigacija">
     <ul>
        <li><a href="prva.html">DOMOV</a></li>
        <li><a href="galerija.html">GALERIJA</a></li>
        <li><a href="http://localhost:3000">NALOŽI SLIKO</a></li>
     </ul>
    </div>

    <script>
        var folder = "uploads/";

        $.ajax({
            url : folder,
            success: function (data) {
                $(data).find("a").attr("href", function (i, val) {
                    if( val.match(/\.(jpe?g|png|gif)$/) ) { 
                        $("body").append( "<img src="+ val +">" );
                    } 
                });
            }
        });
    </script>
</body>
</html>

It seems like this javascript code doesnt work in electron app. Any ideas anyone?