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 asp.net 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'); $(boxCtrl).mousemove(jqAutoCompleteMouseMove); $(boxCtrl).keyup(jqAutoCompleteKeyUp); $(boxCtrl).mousedown(jqAutoCompleteMouseDown); }