473,387 Members | 1,464 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,387 software developers and data experts.

Get Url Change

111 100+
Hi,

I had wrote this script to get the changed URL.

I called this in <body onunload = "GetUrl();">

The problem is that it gives the old url but not the changed url.

ie the function url is http://localhost:4241/WorkedOut/Default.aspx
when i changed to www.google.com it gives http://localhost:4241/WorkedOut/Default.aspx but not www.google.com

Expand|Select|Wrap|Line Numbers
  1.     function GetUrl()
  2.     {
  3.          var href    = document.location.href; 
  4.          alert(href);
  5.  
  6.             alert(document.location.host);
  7.     }
  8.  
Thanks in advance
May 12 '08 #1
5 1383
acoder
16,027 Expert Mod 8TB
You can't get the new URL especially if it's from a different domain.

What do you need this information for?
May 12 '08 #2
baburk
111 100+
You can't get the new URL especially if it's from a different domain.

What do you need this information for?
I want this for, if the user enters different url i wants to end the session.
May 13 '08 #3
acoder
16,027 Expert Mod 8TB
Use a timeout instead. After a period of inactivity, terminate the session on the server.
May 13 '08 #4
baburk
111 100+
Use a timeout instead. After a period of inactivity, terminate the session on the server.

But I wants, it should be called suddenly when the user gives another url.
May 13 '08 #5
acoder
16,027 Expert Mod 8TB
Why? What difference would it make?

Say the user goes to another site and then comes back within a minute. Would you want them signed out?
May 13 '08 #6

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

Similar topics

10
by: Fabrizio | last post by:
(Sorry for the crosspost, but I really don't know which is the right newsgroup!) Hi all, I try to change the password to a user that as to change the password at first logon: try {
4
by: active | last post by:
It appears to me that if I change the Control's client size the controls size does not change to agree with the new size. Does it work like the VB6 ScaleWidth and ScaleHeight? That is after I...
2
by: J | last post by:
Hello. I apologize if this isn't the appropriate group for this question but I was wondering if it's possible to allow regular windows domain users to change their passwords through an .asp page? ...
11
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Master Report is: Me.RowSource = "TableOrQueryName"
1
by: monkey1001 | last post by:
my program is suppose to show my due change and i got it working but my change and coins are wrong how can i improve it thank you..(its supposed to be in java)
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.