Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh and return

Status
Not open for further replies.

itsita001

Programmer
Nov 6, 2002
21
0
0
IL
is it possible to control the refresh and return button of a browser? If not is it possible to have a command which would say whether a user came from outside the site, or if refreshed, or hit the rerurn button?
 
itsita001,

unfortunately you don't have a lot of options here with js...
[tt]document.referrer[/tt] will tell you the page they came from...perhaps you can build logic around this.
=========================================================
if (!succeed) try();
-jeff
 
How could icheckif they came from inside my site?
 
document.referrer would contain a URL from within your site, like
Code:
"[URL unfurl="true"]http://www.mysitename.com/page1.html"[/URL]

you could check that
Code:
(document.referrer.indexOf("[URL unfurl="true"]www.mysitename.com")[/URL] > -1)
to see if they came from outside.

=========================================================
if (!succeed) try();
-jeff
 
itsita001,
Try using a server side language such as PHP. That will tell you much more about your client than JS will. Thanx Dave Shaw!
 
"Try using a server side language such as PHP. That will tell you much more about your client than JS will. "

Thanx, but how would i do that exactly??
 
in order to use a server-side language, you need that language installed on your hosting server. see if your web host offers any server-side languages like PHP, ASP, JSP, ColdFusion...

=========================================================
if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top