Solved

Can I read IE address bar?

Posted on 2001-08-03
10
362 Views
Last Modified: 2008-03-04
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
Comment
Question by:sphere301
10 Comments
 
LVL 15

Expert Comment

by:a.marsh
ID: 6347842
Eh?

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

And it is window.location not document.location.

:o)

Ant
0
 

Expert Comment

by:isond
ID: 6348115
Do you mean the bar at the bottom of the explorer window that displays links when you hover over them?
0
 

Expert Comment

by:raghu_hale
ID: 6348328
need some more info..
0
 

Author Comment

by:sphere301
ID: 6348480
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
 
LVL 8

Accepted Solution

by:
bebonham earned 100 total points
ID: 6348504
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 5

Expert Comment

by:Droby10
ID: 6350720
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
 
LVL 19

Expert Comment

by:webwoman
ID: 6353225
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
 

Author Comment

by:sphere301
ID: 6538499
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
 
LVL 12

Expert Comment

by:ahosang
ID: 7955560
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
 

Expert Comment

by:SpideyMod
ID: 8001015
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now