473,387 Members | 1,882 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.

Javascript Redirect

Hi,

I want to ask something. Say I have a homepage oldhomepage.com

Then I have a new homepage called newhomepage.com

Now, I set up a redirection in oldhomepage.com

this.location = http://newhomepage.com

Say I want to check which homepages send traffic to
http://newhomepage.com

Because http://newhomepage.com gets traffic from redirection, than the
referrers in my stats will point at nothing or occasionally
http://oldhomepage.com

Say yahoo.com send traffic to http://oldhomepage.com how should I set
the redirect so that the server at http://newhomepage.com will know
where the real source is?

Should I put

this.location = http://newhomepage.com?referrer=document.referrer

Will that do?
Jul 23 '05 #1
2 1452
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote in message news:<30*****************@PointedEars.de>...
jonathan wrote:
Now, I set up a redirection in oldhomepage.com

this.location = http://newhomepage.com ^ ^
Won't work. The new value must be quoted.
Say I want to check which homepages send traffic to
http://newhomepage.com

Because http://newhomepage.com gets traffic from redirection, than the
referrers in my stats will point at nothing or occasionally
http://oldhomepage.com


Yes, indeed.
Say yahoo.com send traffic to http://oldhomepage.com how should I set
the redirect so that the server at http://newhomepage.com will know
where the real source is?


You could pass the referring URL as query part component.
You could also use URL rewrite (Apache: mod_rewrite).
Should I put

this.location = http://newhomepage.com?referrer=document.referrer


No.
Will that do?

So, how should Ido it then?
No, and redirection with client-side scripting is evil[tm].

<http://www.w3.org/QA/Tips/reback>
PointedEars

Jul 23 '05 #2
jonathan wrote:
Thomas 'PointedEars' Lahn [...] wrote [...]:
jonathan wrote:
> Should I put
>
> this.location = http://newhomepage.com?referrer=document.referrer


No.
> Will that do? So, how should Ido it then?


Like this:
No, and redirection with client-side scripting is evil[tm].

<http://www.w3.org/QA/Tips/reback>


And you should really <http://netmeister.org/news/learn2quote.html>.
PointedEars
Jul 23 '05 #3

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

Similar topics

1
by: Ryann | last post by:
I hate javascript looking for help. I am trying to pass hidden fields around without showing a query string in the address bar. e.g. formA.asp not formA.asp?var1=blah&var2=blah I have...
0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
9
by: SHarris | last post by:
Hello, In our new intranet ASP.NET project, two requirements are that the browser accept cookies AND JavaScript. We are requiring the use of Internet Explorer 6+. 1. Using C# in an ASP.NET...
3
by: Shapper | last post by:
Hello, I am working on an ASP.NET/VB web site. I have several links including menu links. Considerer a want to load a page named page.aspx. I can do it using javascript. Or using this code:...
3
by: TJ | last post by:
Hi, I would like to ask something to user after user submits the form... I know I can ask user whehter they want to submit the form or not using client-script code such as onClick or onSubmit by...
2
by: SteveSu | last post by:
Hi! I want to make a postback when the user hits the escape-button on the keyboard and redirect the user to another page. But the response.redirect does not work for me in this "context". I´m...
8
by: Taras_96 | last post by:
Hi everyone, We' ve come to the conclusion that we wish the user to be directed to an error page if javascript is disabled <enter comment about how a webpage shouldn't rely on javascript here :)...
1
by: rkagrawal | last post by:
I am not sure if this is the right forum to post about this problem , but , i just want to discuss a problem i recently encountered. I was developing a page in ASP , where i came across a problem....
2
by: Seth Williams | last post by:
In the middle of my event handler (for a button), I have an if/then statement (using vb.net): if (whatever) then strScript="<script ....... strScript &= alert('This is an alert') strscript...
2
by: Rahina | last post by:
I am working in Dreamweaver 8, and I have created a simple form: http://www.realmofmystery.com/app.html This is a free website I am doing for some friends, so nothing fancy. And, I learned web...
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:
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
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
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...

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.