NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page JavaScript window.location.replace issue

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 10-10-2003, 08:37 AM THREAD STARTER               #1 (permalink)
NamePros Member
 
Mp)Tarh's Avatar
Join Date: Aug 2003
Location: Ontario, Canada
Posts: 98
Mp)Tarh is an unknown quantity at this point
 



JavaScript window.location.replace issue


Alright, I can't figure out what is wrong with this code!

You will notice I added alert boxes, but they didn't help.
????: NamePros.com http://www.namepros.com/programming/15364-javascript-window-location-replace-issue.html

I narrowed the problem down to the window.location.replace on line 209.

Please help!!!
---------------------------------------------------------------------
<%@ LANGUAGE="VBSCRIPT" %>
<% OPTION EXPLICIT %>
<% Response.Buffer = True %>
<%
Response.Write "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"">"
Response.Write "<HTML>"
Response.Write "<HEAD>"
Response.Write "<meta http-equiv=""Content-Type"" content=""text/html; charset=windows-1252"">"
Response.Write "<TITLE>***** **** ******** Website</TITLE>"
Response.Write "</HEAD>"
Response.Write "<BODY BGCOLOR=""#999999"" TEXT=""#FFFFFF"" LINK=""#FFFFFF"" ALINK=""#FFFFFF"" VLINK=""#FFFFFF"">"
Response.Flush

Response.Write "<P ALIGN=""center"">Please wait while we perform an extensive check on the program and computer you are using.<BR>"
Response.Write "This is needed to ensure that features you don't support are disabled.</P>"
Response.Write "<P ALIGN=""center"">If you are stuck on this page and have not been redirected for 2 minutes or more, your computer program is too old to view our website.<BR>"
Response.Write "Please click <A HREF=""sorry.htm""><b>here</b></a> for more information about this problem.</P>"
Response.Flush
%>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
var bad;
bad = false;

var status;
status = true;

if (!navigator.userAgent)
{
bad = true;
}

var gecko;
var geckobuild;

function geckos()
{
var agt;
agt = navigator.userAgent.toLowerCase();

if (agt.indexOf("gecko") != - 1)
{
var geckoind;
geckoind = agt.indexOf("gecko");
var geckostr;
geckostr = agt.substring(geckoind,geckoind+14);

gecko = true;
var splitg;
splitg = geckostr.split("/");
var gy;
var gm;
var gd;

gy = splitg[1].substr(0,4);
gm = splitg[1].substr(4,2);
gd = splitg[1].substr(6,2);

geckobuild = gd + ":" + gm + ":" + gy;
} else {
gecko = false;
geckobuild = "N/A";
}
}

geckos();

var dhtml;
var javascript;
var cookiesen;
var frames1;
var forms1;
var images1;
var iframes;

if (document.getElementById)
{
dhtml = "A";
} else {
if (document.all || document.layers)
{
dhtml = "B";
} else {
dhtml = "F";
}
}

javascript = "C";
//-->
</SCRIPT>
<NOSCRIPT>
<P ALIGN="center">An error occured. &nbsp;Please click the link above.</P>
</NOSCRIPT>

<SCRIPT LANGUAGE="JavaScript1.1" TYPE="text/javascript">
<!--
javascript = "B";
//-->
</SCRIPT>
<NOSCRIPT>
<B></B>
</NOSCRIPT>

<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
<!--
javascript = "A";
//-->
</SCRIPT>
<NOSCRIPT>
<B></B>
</NOSCRIPT>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
if (bad == true)
{
javascript = "D";
}

document.cookie = "testing=hello";
var tmpvar = document.cookie;
if (tmpvar.indexOf("testing=hello") != -1)
{
cookiesen = true;
document.cookie = "";
} else {
cookiesen = false;
}

if (document.frames)
{
frames1 = true;
} else {
frames1 = false;
}

if (document.forms)
{
forms1 = true;
} else {
forms1 = false;
}

if (document.images)
{
images1 = true;
} else {
images1 = false;
}

var loopingt;
loopingt = 0;

iframes = true;
if (javascript == "C")
{
document.write("<BR><HR><BR><P ALIGN="center"><A HREF="sorry.htm">Click here for more information</A></P><P ALIGN="center">Your browser does not support JavaScript 1.1 or JavaScript 1.2. &nbsp;You must update it to view our website.</P><BR><BR>");
????: NamePros.com http://www.namepros.com/showthread.php?t=15364
}

if (cookiesen == false)
{
document.write("<BR><HR><BR><P ALIGN="center"><A HREF="sorry.htm">Click here for more information</A></P><P ALIGN="center">Your browser does not have Cookies Enabled. &nbsp;You must enable them to view our website.<BR>");
document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To enable cookies in Netscape click the TOOLS menu from the top of your screen, move your mouse over COOKIES MANAGER and click UNBLOCK COOKIES FROM THIS SITE.<BR><BR>");
document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To enable cookies in Internet Explorer click the TOOLS menu from the top of your screen and click INTERNET OPTIONS. &nbsp;Now select the PRIVACY tab, and modify your settings to accept cookies.</P><BR><BR>");
}

if (frames1 == false)
{
document.write("<BR><HR><BR><P ALIGN="center"><A HREF="sorry.htm">Click here for more information</A></P><P ALIGN="center">Your browser does not support FRAMES, which allows us to show you more than 1 page at once. &nbsp;It is required to view this website. &nbsp;For more information, click the link above.</P><BR><BR>");
}

if (forms1 == false)
{
document.write("<BR><HR><BR><P ALIGN="center"><A HREF="sorry.htm">Click here for more information</A></P><P ALIGN="center">Your browser does not support FORMS, which allows us to obtain information from you. &nbsp;This feature is required to view this website. &nbsp;For more information, click the link above.</P><BR><BR>");
}

if (images1 == false)
{
document.write("<BR><HR><BR><P ALIGN="center"><A HREF="sorry.htm">Click here for more information</A></P><P ALIGN="center">Your browser does not support IMAGES, and our website requires it. &nbsp;For more information, click the link above.</P><BR><BR>");
}

if (iframes == false)
{
document.write("<BR><HR><BR><P ALIGN="center"><A HREF="sorry.htm">Click here for more information</A></P><P ALIGN="center">Your browser does not support IFRAMES, an advanced version of FRAMES. &nbsp;It is required to view this website. &nbsp;For more information, click the link above.</P><BR><BR>");
}

if (javascript == "B" || javascript == "A")
{
if (cookiesen == true)
{
if (frames1 == true)
{
if (forms1 == true)
{
if (images1 == true)
{
if (iframes == true)
{
document.cookie = "gecko=" + gecko;
document.cookie = "geckobuild=" + geckobuild;
document.cookie = "dhtml=" + dhtml;
document.cookie = "javascript=" + javascript;
document.cookie = "cookiesen=" + cookiesen;
document.cookie = "frames1=" + frames1;
document.cookie = "forms1=" + forms1;
document.cookie = "images1=" + images1;
document.cookie = "iframes=" + iframes;
document.cookie = "welcome=afgw2qxypfghtuybnslpowfjharq52rf7a21ve7f2 5hadfh7s3ag6r8s7agsd4v7as687w86gw7t";
window.location.replace("http://www.mywebsite.com/directory/file.asp");
} else {
alert("oops7");
}
} else {
alert("oops6");
}
} else {
alert("oops5");
}
} else {
alert("oops4");
}
} else {
alert("oops3");
}
} else {
alert("oops2");
}
//-->
</SCRIPT>
<NOSCRIPT>
<B></B>
</NOSCRIPT>
<%
Response.Write "</BODY>"
Response.Write "</HTML>"
Response.Flush
%>
---------------------------------------------------------------------
__________________
Yeah... I knew that. What?
Mp)Tarh is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 12:49 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger