Change logo dynamically using jQuery

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
twuc
User
Posts: 72

Change logo dynamically using jQuery

Post by twuc »

I want to change the brand logo dynamically, depending on the user logged in. But first I've uploaded an image, and have the following line in Client Scripts>Global>Pages with header and footer>Startup Script to test the principle:

        $(".img.brand-image.ew-brand-image").attr("src", "/images/myimage.png");

Firstly, even though I can see the script is executed in Console, there is no change to the image. Is this script correct?
Secondly, where's the best place to look to find out how to get the image name from the database to do this?


arbei
User
Posts: 9384

Post by arbei »

You need to set the src property, not the attribute, you may try .prop().


Post Reply