set css image from current folder using jquery script page

I have an external Javascript page located under ../Scripts/CBox/ folder from parent.
There is an image located in the same folder. I want to set background-image for a control using Jquery from there. When I use this code, It sets the background-image path as localhost:7905/ddl_arrow.png where localhost:7905 is my development server.

 function createAutoCBox(boxCtrl) {

    $(boxCtrl).css('background-image', 'url("ddl_arrow.png")'); 
    $(boxCtrl).css('background-repeat', 'no-repeat');
    $(boxCtrl).css('background-position-x', '99%');
    $(boxCtrl).css('background-position-y', '-2px'); 

Source: css

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.