HTML:
Put this code into the head section:
<base id="BaseUrl" data-baseurl="@Context.Request.Url.GetLeftPart(UriPartial.Authority)@Url.Content("~/")" />
jQuery:
<script type="text/javascript">
var rootUrl;
$(document).ready(function () {
rootUrl= $("#BaseUrl").data("baseurl");
});
</script>
No comments:
Post a Comment