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

can JS suss out "on-site" vs off-site HTTP requests?

this may be more of an "html" issue, but I'll wing it.

i've got a multi-language site, where the home-page of each language group
features a link to a popup window that offers background info on site
management. the popup is fired by a javascript function, when they click
the site management link. there's also a "window close" function button so
they can nuke it as they please.

now, oddly, people who search for my site in the chinese language on google,
are sent directly to the site management popup window, which of course,
opens in their "full" browser window, and which also has no links back to
the main site, because it's meant to open only as an "accessory" to the main
site.

my question is this: is there any way, with Javascript, that I could
determine if they arrived at this window from "off-site" (ie, a google
search), and therefore offer such "off-site" visitors a link back to the
principal site, a link that would be hidden for visitors who clicked the
popup window from my own site?

hope this is not confusing...! Thanks for any help offered.
WordPainter
Dec 5 '06 #1
2 1726
Word Painter wrote :
this may be more of an "html" issue, but I'll wing it.

i've got a multi-language site, where the home-page of each language group
features a link to a popup window that offers background info on site
management. the popup is fired by a javascript function, when they click
the site management link. there's also a "window close" function button so
they can nuke it as they please.

now, oddly, people who search for my site in the chinese language on google,
are sent directly to the site management popup window, which of course,
opens in their "full" browser window, and which also has no links back to
the main site, because it's meant to open only as an "accessory" to the main
site.

my question is this: is there any way, with Javascript, that I could
determine if they arrived at this window from "off-site" (ie, a google
search), and therefore offer such "off-site" visitors a link back to the
principal site, a link that would be hidden for visitors who clicked the
popup window from my own site?

hope this is not confusing...! Thanks for any help offered.
WordPainter

http://developer.mozilla.org/en/docs/DOM:window.opener

This may help you if you use window.open to open your link ;)
It allow you to have a reference on the opener window. If none, it means it has
been accessed directly, and then should be redirected.

You also have the $_SERVER['HTTP_REFERER'] in PHP, and the equivalent may exist
in many other web languages :)

--
Naixn
http://fma-fr.net
Dec 5 '06 #2
naixn wrote:
You also have the $_SERVER['HTTP_REFERER'] in PHP, and the equivalent may
exist in many other web languages :)
It is well known that Referer coding simply does not work on the Web, since
not all UAs submit that header, depending on the security level and user
preferences.
PointedEars
--
Let us not judge others because of their religion, color or nationality.
We are all just human beings living together on this planet. (poehoe.de)
Dec 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kevin Schneider | last post by:
Please forgive me if this is a bit off topic, but I haven't had any takers in other forums. With ASP.NET projects, is it possible to have VS.NET automatically change the configuration options of...
1
by: fang | last post by:
Really confusing, I am using visual stdio C++ 6.0 I add a new project file into my current workspace. If I use the default output directory like default and release, everything works fine. But...
3
by: Stinky Pete | last post by:
I've mananged to get Access Run-time working on a Win 98 PC. I was stoked at that achievement, however I'm now stuck in that the files are opening Read only. That is, I can view all the records...
6
by: GoogleGroups | last post by:
"Residual" is the diff between returns of two funds. I've got a form. The form will have two and only two records on it: one for Fund#1 and the other for Fund#2. Each record contains...
6
by: MLH | last post by:
You know, snap to grid when dragging a new command button or other object? If you used autocad (command line DOS) YOU know exactly what I mean. I want to size my objects - not be forced to snap...
35
by: David Cleaver | last post by:
Hello all, I was wondering if there were some sort of limitations on the "if" statement? I'm writing a program which needs to check a bunch of conditions all at the same time (basically). And...
1
by: Adam Clauss | last post by:
I have a doc/view app w/ a CRichEditView. In it, I define: void CSyntaxView::ParseLine(long lineNum); This function starts off by getting the text of the specified line (into a CString): ...
2
by: Juan Pedro Gonzalez | last post by:
I am a bit unsure about this "Effect"... My code: Public Sub Main() Application.EnableVisualStyles() Application.DoEvents() Dim myMainForm As New FormularioPrincipal Dim mySplash As New...
2
by: James | last post by:
User has a input as "SwitchName = ON" or "SwitchName = OFF", how to use C# Regex to get SwitchName and the value? Regex.Match(line, @"(\S+) = {ON|OFF}") does not work.
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.