How to get relative path in Javascript?

前端 未结 6 715
野的像风
野的像风 2020-12-09 18:47

In my ASP.net web project, I\'ve written the following Javascript code in a .js file:

function getDeviceTypes() {
    var deviceTypes;
    $.ajax({
        a         


        
6条回答
  •  半阙折子戏
    2020-12-09 19:30

    You can import the namespace at the beginning: System.Web.Hosting.HostingEnvironment

      <%@ Master Language="VB" AutoEventWireup="false" CodeFile="Site.master.vb" Inherits="Site" %>
       <%@ Import namespace="System.Web.Hosting.HostingEnvironment" %>
    

    and on js:

      
    

提交回复
热议问题