문제

How can I refer root path in Javascript like:

$.blockUI.defaults.growlCSS['background'] = 'url(~/Styles/images/check48.gif) no-repeat 10px 10px #000; ';
도움이 되었습니까?

해결책

Biju was wondering how to solve this in javascript, a way to do it is:

var path = window.location.protocol + '//' + window.location.host + '/'; // or whatever you want to set it to
$.blockUI.defaults.growlCSS['background'] = 'url(' + path + 'Styles/images/check48.gif) no-repeat 10px 10px #000; ';
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top