how to render the relative path with tilde into ../../ of relative path in jquery/javascript?

前端 未结 4 496
离开以前
离开以前 2021-02-06 16:50

Well, i understand my title is a bit confusing. I will state it clearly below with the example.



        
4条回答
  •  粉色の甜心
    2021-02-06 17:46

    WebControls translate the tilde into the correct path when run on the server before rendering the html, you will need to use the full path or relative path in jQuery if you're changing the src on the fly.

    You might want to have a property on the page with the root path eg: ApplicationRootURL and do something like this:

    
    

提交回复
热议问题