0

I have the following JS code:

applyBefore: {
            backgroundImage: 'url(/myPath/furniture/images/careers/birds/pigeon_flap_medium.gif?' + Math.random() + ')',
            contentFlyOut: {
                direction: 'top',
                delay: 0.5,
                node: '#our-history-content'
            }
        }

... which works fine, BUT, I need the value of '/myPath' to be whatever the value of a variable called 'binaryContextRoot' is, as this code will run of different servers where the value of 'binaryContextRootwill differ server to server.

I'm struggling with the correct syntax to get 'binaryContextRoot' in the 'url' path.

I have tried:

backgroundImage: 'url("+binaryContextRoot+"/furniture/images...

where 'binaryContextRoute' is '/myPath', but with no success. The path is not recognised/found, so obvioulsy the value of "+binaryContextRoot+" is incorrect.

Can anyone help please? :)

Many thanks

1 Answer 1

6
backgroundImage: 'url(' + binaryContextRoot + '/furniture/images...'
Sign up to request clarification or add additional context in comments.

1 Comment

That is superb RASG! So obviuous when I look at it. Many thanks! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.