Consider the need to $.post()
to a slightly different URL structure in the Visual Studio Dev environment vs. deployed IIS Production or Test environment.
When deployed to the Test server, the app is running under a Virtual Directory in IIS. The URL will be something like:
Deployed
URL: http://myServer/myApplication/Area/Controller/Action
Using jQuery's .post()
, I need to supply the string:
$.post( "/myApplication/myArea/myController/myMethod"
Development
When in the Visual Studio environment
Cassini URL is: http://localhost:123/Area/Controller/Action
Using jQuery's .post()
, I need to supply the string:
$.post( "/myArea/myController/myMethod"
Question: How can I make both these use the same line of code, regardless of their deployed environment?