473,396 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to read urls from addressbar through javascript

Hi Dudes,

I have a query regarding browser url.Let me narrate the exact scenario
which i need.


I would like to expire my session when a person enters different url
in the navigator bar other than my url and comes back to my url.
For example if i visit example.com and then i type gmail in the same
navigator bar and then move back to my url example.com through browser
back button then i have to end the session of my client i mean he has
no more access to my site.


The same scenario is there for icicibank.com.
I wanna the code using php and javascript.
Please help me.
Its urgent. Expecting the favor.
Thank you
Dec 4 '07 #1
1 1182
Dasty
101 Expert 100+
The question is, should JS from site X be informed that I just entered site Y in my browser? (that's the information you are trying to obtain) The answer is no. JS should (and i hope is) able to get just data that belongs to it's page scope (+some minor data about browser's dimensions etc). The only thing you can use is onload and onunload events. The problem is, that different browsers implement those events differently. (for example Opera doesn't trigger onunload/onload when you are using back/forward buttons in browser - and it's not a bug. Just different browsers got different answers to question: "when does user leaves the page?" - opera thinks that user using back/forward buttons does not really leave the page :)). But I really dont know what else you can use ...
Dec 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: mikeyjudkins | last post by:
Ive been banging my head on the wall for hours with this one, hopefully someone will know what Im doing wrong here :\ The Goal: I have an xml file that is generated on the fly via JSP which I...
6
by: Matt | last post by:
I want to disable the title bar, status bar and address bar of a window, but I couldn't find the syntax. I tried the following but not working. any ideas?? window.document.statusbar.enable =...
2
by: Rainer Dorsch | last post by:
Hello, I am wondering, if there is a easy way (for a programmer, but non-javascript programmer) to find out which new URL is requested from javascript. E.g. ...
26
by: Howard Brazee | last post by:
I would like to click on a URL of a html document that will open several URLs at once for me. Does someone have an example of a html document that will do this?
13
by: Ron Eggler | last post by:
Hi, is it possible to read out the Addressbar with javascript or do I have to use php for it? Thank you! -- roN www.rideon.ch
3
by: Tony A. | last post by:
Quick question - would I be right in saying that urls in for example css content or background-image elements cannot be a javascript: or data: type urls? Doesn't seem to work in Firefox 1.5, just...
5
by: eureka | last post by:
Hi All, I need to store the address-bar content of a web page into a string variable , Is there any way I can achieve this through JavaScript?
5
by: nazeers | last post by:
Hi All, Earlier I haved posted the issue for fetching the base URLs from the xml file and got some valubale help from this Forum. With the given inputs ... i was able to code to fetch all the...
6
by: davidson1 | last post by:
Hai friends... suppose if am browing MSN.com if i want that url should come to addressbar what i have to do.....so that nexttime without typing it..i can take from that..... can u help me
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.