Build Your own function - complex parameter msgType Images not showing up


I am working my way through the MDN JS tutorials and am stuck just before the test your skills part.
The problem I want to solve is connected to the images not showing up in the message box.





GitHub works fine:
GitHub - Live
GitHub - Code

My version doesn’t - colors are changing depending on the type of parameter, so that part works. I have tried solving the problem with relative path and to no avail.

      if (msgType === 'warning') { = 'url(icons/warning.png)'; = 'red';
    } else if ( msgType === 'chat') { = 'url(icons/chat.png)'; = 'aqua';
    } else { = '20px';

What I did find though is this


inline style has the background-image value set with double, double quotes.
Is this the source of the problem ?

Hello @H4m4k

is this the topic you talking about

could you share the full code in any of the online sharing service like codepen or jsfiddle or anything else

and have a nice day :slight_smile:

Hello @justsomeone

yes that is the exact topic I had in mind.

and a nice day for You too :slight_smile:

Hello @H4m4k

you need to put the image file in your project if you inspect the result panel

you would see it can not load the image

and from this screen shoot i only see the html file in your project

Screenshot from 2020-10-16 01-21-19

the full path to the image is

so change this = 'url(icons/warning.png)';

to this = 'url(';

hope that help and have a nice day