Reputation: 438
How can I refer root path in Javascript like:
$.blockUI.defaults.growlCSS['background'] = 'url(~/Styles/images/check48.gif) no-repeat 10px 10px #000; ';
Upvotes: 0
Views: 786
Reputation: 401
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; ';
Upvotes: 1