By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,381 Members | 1,626 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,381 IT Pros & Developers. It's quick & easy.

Redirection with javascript

P: n/a
Hi, I must create a redirect :

1@mysite.com must open www.mysite.com and The url must remain 1
@mysite.com

I have obtain redirect correctly with this code :

<script language="Javascript">
<!--
var indirizzo = window.location;
if (indirizzo == 'http://www.mysite.com/') {
location.href = "http://www.mysite.com/index_norm.php";
}
if (indirizzo == 'http://ge**@mysite.com/') {
location.href= "http://www.mysite.com/gest/";
}
if (indirizzo == 'http://bi****@mysite.com/') {
location.href= "http://www.mysite.com/biella/";
}

-->
</script>

NOW , this it's ok but the url change in the bar adress , so use this :

<script language="Javascript">
<!--
var indirizzo = window.location;
if (indirizzo == 'http://www.mysite.com/') {
var dest = "http://www.mysite.com/index_norm.php";
}
if (indirizzo == 'http://ge**@mysite.com/') {
var dest= "http://www.mysite.com/gest/";
}
if (indirizzo == 'http://bi****@mysite.com/') {
var dest= "http://www.mysite.com/biella/";
}
-->
</script>
</head>

<body>
<FRAMESET ROWS="*,0" FRAMEBORDER=0 BORDER=0 FRAMESPACING=0>
<FRAME SRC="WRITE VAR VALUE HERE" NORESIZE>
</FRAMESET><noframes></noframes>
</body>

BUT, HOW can I write the var value in the body ?

thks
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
hi************@aol.com (HikksNotAtHome) wrote in
news:20***************************@mb-m29.aol.com:
In article <rp********************@news2.tin.it>, Webstyler
<no**@none.it> writes:
if (indirizzo == 'http://bi****@mysite.com/') {
var dest= "http://www.mysite.com/biella/";
}
-->
</script>
</head>
<FRAMESET ROWS="*,0" FRAMEBORDER=0 BORDER=0 FRAMESPACING=0>
<FRAME SRC="WRITE VAR VALUE HERE" NORESIZE>
</FRAMESET><noframes></noframes>
BUT, HOW can I write the var value in the body ?


Instead of :
<FRAME SRC="WRITE VAR VALUE HERE" NORESIZE>

<script type="text/javascript">
document.write('<frame src=" ' + dest + ' " noresize>');
</script>


sorry, but don't work
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.