There are a couple of ways getting the url within javascript:
Netlobo.com - Get URL Parameters Using Javascript
mattwhite.me - Get URL Parameter in Javascript
It's all about this function: document.location.href
To get the url with APEX features just follow these posts:
Oracle Apex Notebook - Get server URL in Apex
APEX forum - Display current URL on page
APEX forum - How to get the Current page's URL to an Item?
APEX forum - How to get Current URL in Apex?
Netlobo.com - Get URL Parameters Using Javascript
mattwhite.me - Get URL Parameter in Javascript
It's all about this function: document.location.href
To get the url with APEX features just follow these posts:
Oracle Apex Notebook - Get server URL in Apex
APEX forum - Display current URL on page
APEX forum - How to get the Current page's URL to an Item?
APEX forum - How to get Current URL in Apex?