You need to sign in to do that
Don't have an account?

getting the domain origin from $Origin
i am trying to set value of custom url field to a visualforce page to for that i need domain oring prefix like ap1.salesforce.com or na1.salesforce.com .how to get that in UI it is showing some global objects $Organization,$Profile,$System,$User,$UserRole which object should be used and which field please tell
<script>
var url = location.href;
alert(url);
</script>
$Api might prove useful (for your purposes it doesn't matter which version you use).