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

Redirect using a J Script

Hi

I would like to redirect say from http://mysite.co.uk to
http://www.mysite.co.uk but because my home page is html I have to use JS

Thank you,
Samuel
Nov 28 '06 #1
5 2001
Samuel Shulman wrote:
Hi

I would like to redirect say from http://mysite.co.uk to
http://www.mysite.co.uk but because my home page is html I have to use JS
Javascript isn't the best solution for this since a lot of people surf
without it. Instead set up a meta tag in your html in addition to
javascript:

<meta http-equiv="refresh" content="5;url=http://www.yoururl.com">

And the javascript equivalent.

<script language="JavaScript" type="text/javascript">
<!--
document.location.href = 'www.yoururl.com';
//-->
</script>


--
---------------------------------------------------------------------------
http://www.hunlock.com -- Permanently under construction (And proud of it!)
$FA
Nov 28 '06 #2
Thank you,

Samuel

"pcx99" <x@x.comwrote in message
news:1z******************@newssvr13.news.prodigy.c om...
Samuel Shulman wrote:
>Hi

I would like to redirect say from http://mysite.co.uk to
http://www.mysite.co.uk but because my home page is html I have to use JS

Javascript isn't the best solution for this since a lot of people surf
without it. Instead set up a meta tag in your html in addition to
javascript:

<meta http-equiv="refresh" content="5;url=http://www.yoururl.com">

And the javascript equivalent.

<script language="JavaScript" type="text/javascript">
<!--
document.location.href = 'www.yoururl.com';
//-->
</script>


--
---------------------------------------------------------------------------
http://www.hunlock.com -- Permanently under construction (And proud of
it!)
$FA

Nov 28 '06 #3
The <metaoption doesn't stop refreshing

The JS works very good

Thanks ,
Samuel
"pcx99" <x@x.comwrote in message
news:1z******************@newssvr13.news.prodigy.c om...
Samuel Shulman wrote:
>Hi

I would like to redirect say from http://mysite.co.uk to
http://www.mysite.co.uk but because my home page is html I have to use JS

Javascript isn't the best solution for this since a lot of people surf
without it. Instead set up a meta tag in your html in addition to
javascript:

<meta http-equiv="refresh" content="5;url=http://www.yoururl.com">

And the javascript equivalent.

<script language="JavaScript" type="text/javascript">
<!--
document.location.href = 'www.yoururl.com';
//-->
</script>


--
---------------------------------------------------------------------------
http://www.hunlock.com -- Permanently under construction (And proud of
it!)
$FA

Nov 28 '06 #4
Actually the JS also needed a condition

Is there condition to the meta tag?

"pcx99" <x@x.comwrote in message
news:1z******************@newssvr13.news.prodigy.c om...
Samuel Shulman wrote:
>Hi

I would like to redirect say from http://mysite.co.uk to
http://www.mysite.co.uk but because my home page is html I have to use JS

Javascript isn't the best solution for this since a lot of people surf
without it. Instead set up a meta tag in your html in addition to
javascript:

<meta http-equiv="refresh" content="5;url=http://www.yoururl.com">

And the javascript equivalent.

<script language="JavaScript" type="text/javascript">
<!--
document.location.href = 'www.yoururl.com';
//-->
</script>


--
---------------------------------------------------------------------------
http://www.hunlock.com -- Permanently under construction (And proud of
it!)
$FA

Nov 28 '06 #5
pcx99 wrote on 28 nov 2006 in comp.lang.javascript:
Samuel Shulman wrote:
>Hi

I would like to redirect say from http://mysite.co.uk to
http://www.mysite.co.uk but because my home page is html I have to
use JS

Javascript isn't the best solution for this since a lot of people surf
without it. Instead set up a meta tag in your html in addition to
javascript:

<meta http-equiv="refresh" content="5;url=http://www.yoururl.com">

And the javascript equivalent.

<script language="JavaScript" type="text/javascript">
<!--
document.location.href = 'www.yoururl.com';
'http://www.yoururl.com/'
//-->
</script>
Which could and should be shortened without any penalty to:

<script type='text/javascript'>
document.location.href = 'http://www.yoururl.com/';
</script>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 28 '06 #6

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

Similar topics

10
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?>...
3
by: Sean Berry | last post by:
Hi there. I am relativly new to Python CGI and need a question answered. I have made custom 404 error pages and have them in various web directories. I have not been able to figure out a way...
8
by: Don Miller | last post by:
I have an ASP script that is called from a PDF form to process form data. On the last line of the script I have a Response.Redirect "webpage.asp" that leads to another target page with actual HTML....
7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
2
by: Glen Wilkin via DotNetMonster.com | last post by:
Is there a way I can call Response.Redirect after I've done a Response.Flush? I send some html to load an animated gif that plays whilst my page loads, it has some extensive database calls to...
4
by: Martyn Fewtrell | last post by:
Hi there I am developing an ASP.Net form which submits to a non ASP.net script (not through choice!). Basically the form collates a whole bunch of data and builds a query string from the...
3
by: PKin via DotNetMonster.com | last post by:
Hi, I really need som help here. I have read a lot of thread about Frames ans response.redirect and I know by now that I cannot use response redirect and I have to use "some kind of javascript on...
15
by: KBuser | last post by:
I recently developed an internal website with various queries against our SQL server. I added buttons with Response.Redirect. These buttons do not work with Internet Explorer, however when using...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
7
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I...
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: 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
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
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...
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...

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.