0

如何在 Javascript 中引用根路径,例如:

$.blockUI.defaults.growlCSS['background'] = 'url(~/Styles/images/check48.gif) no-repeat 10px 10px #000; ';
4

1 回答 1

1

Biju想知道如何在javascript中解决这个问题,一种方法是:

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; ';
于 2012-11-09T09:47:55.423 回答