Function to get URL of current stateless form

Function to get URL of current stateless form

Hi, is posible to get the URL of an active stateless form, from a script called by a custom button in the same form ? 

I dont think hardcoding URL is a good idea, because if I change the development envoirment URL is going to change