So I am writing a jquery Plugin using grunt, and in my plugin I also need to call webservices.
The webservice url domain will always be the same domain as the location of the .js file the user needs to add for our plugin. So i.e. Relative
1) Include JS file for plugin
2) In my JS call API URL
Needs to be
api_domain: "http://mydomain1/api/v1"
And I want the api domain to be relative to domain of the JS file calling it I tried doing
api_domain: "/mydomain1/api/v1"
But this picks up the domain name of the browser.
So I was wondering what the best way to achieve this
1) Use a .NET Handler to insert the right domain name from context.request.url
2) In Grunt build create a specific .js for each environment I will deploy to which has the full url in the JS
3) Other Options ?