get the url from the address bar

I'm building a site that runs in the search panel of IE and i'm trying to get the url from the main window, it's now starting to drive me nuts.
Has anybody got any ideas. i've tried javascript parent.location.href.
Cheers
[259 byte] By [david_hemingway] at [2007-11-18 5:44:03]
# 1 Re: get the url from the address bar
I am not sure about

building a site that runs in the search panel of IE

may be this will work

top.location.href

Satish
Satishpp at 2007-11-8 0:13:58 >
# 2 Re: get the url from the address bar
No it dosn't i've tried that. It looks like i have to use something along the lines of external.location.href but have never used this before and keeps returning errors, also found some stuff on the webBrowser.LocationURL but that's not clear and again all i'm getting is errors
david_hemingway at 2007-11-8 0:14:58 >
# 3 Re: get the url from the address bar
try referencing the document i.e. parent.document.location.href or top.document.location.href

the "parent" and "top" refs are to window objects, which contain a document object . Window objects do not have an href property.
nategrover at 2007-11-8 0:15:57 >
# 4 Re: get the url from the address bar
I am new to Java Script.
Can you post the code to get URL from address bar?
I am working on project for blind people.
Thanks.
ketakimd at 2007-11-8 0:16:59 >
# 5 Re: get the url from the address bar
Location is how you read the address. It has multiple options available to it so you need to lookup the details. In your case you use href to get the address. So based on this say you want to write the address inside your page when loaded you could do.

<html>
<body>

<script language=javascript>
document.write(location.href);
</script>

</body>
</html>
antares686 at 2007-11-8 0:17:58 >
# 6 Re: get the url from the address bar
Thanks a lot.
This works.
ketakimd at 2007-11-8 0:19:01 >