Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

Can I read IE address bar?

Hi,

is it possible with javascript/vbscript to get what's in IE address bar(the URL field)?
I don't mean document.location.href, but the text from the address bar.

Thanks
0
sphere301
Asked:
sphere301
1 Solution
 
a.marshCommented:
Eh?

I'm afraid you've lost me....

And it is window.location not document.location.

:o)

Ant
0
 
isondCommented:
Do you mean the bar at the bottom of the explorer window that displays links when you hover over them?
0
 
raghu_haleCommented:
need some more info..
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
sphere301Author Commented:
No, I mean the address bar which usually stays at the top of the browser window and where you enter the url you want to visit. For example, my address bar now shows
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=javascript&qid=20162676

0
 
bebonhamCommented:
no...

you can't read the text from there.

when you read location, you are loading the page that is currently loaded in the browser.

9/10 times that is the same is in the address bar...but if I typed foo in the the address bar, and then clicked a button on my page that had onclick=alert(window.location.href)
I would not get foo

I think you are wanting to see what page someone leaves to?
which I don't believe possible through javascript alone

hope that helps

Bob
0
 
Droby10Commented:
the location object is bound to both the document and window in IE (this provides sourced elements with their own location object)...but this reference should not be used if cross-compatibility is an issue; it will work with netscape up to at least 4.0 (even though they suggest using document.URL)

...because netscape 6 has yet to implement LiveConnect i don't program for the environment and couldn't even begin to tell you what would be the appropriate usage.  it's always a safe bet to use window.location if you're not needing to change or fetch location objects from sourced elements.
0
 
webwomanCommented:
document.URL will get you the URL string for the current page. Carries any querystring too.

You can't WRITE to that, it's a read-only object.
0
 
sphere301Author Commented:
I don't want to write to the URL field, I just want to check what's in there. This may not be the same as the url of the currently loaded document because after the page loads you can type there whatever you like and the same page will be still loaded
0
 
ahosangCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
points to bebonham
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ahosang
EE Cleanup Volunteer
0
 
SpideyModCommented:
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now