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
# 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
# 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.
# 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.
# 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>