Code Problem

  • 1
  • Problem
  • Updated 7 years ago
I put some code on my page and it messes up the editor\
My url is 54cubs.yolasite.com
the code is is as follows:

/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: William Bontrager | http://www.bontragerconnection.com/ */
// Copyright 2006 Bontrager Connection, LLC
// This version of the script redirects automatically.
// The Web site has a few other methods for directing also:
// http://www.bontragerconnection.com/li...

// Three items can be customized (values between quotation marks):
//
// 1. What URL shall the browser be redirected
// to if a cookie was previously set?

var RedirectURL = "http://shamar.org";

// 2. How many days shall the cookie live in
// the visitor's browser (0 means remove
// cookie whenever browser closes)?

var DaysToLive = "365";

// 3. What name shall the cookie have (any
// sequence of alphabetical characters
// is okay, so long as the name doesn't
// conflict with any other cookies that
// this web page might be setting.)?

var CookieName = "HasVisited";

// No other customization is required.

function Action() {
location.href = RedirectURL;
}

DaysToLive = parseInt(DaysToLive);
var Value = 'bypass page next time';

function GetCookie() {
var cookiecontent = '';
if(document.cookie.length > 0) {
var cookiename = CookieName + '=';
var cookiebegin = document.cookie.indexOf(cookiename);
var cookieend = 0;
if(cookiebegin > -1) {
cookiebegin += cookiename.length;
cookieend = document.cookie.indexOf(";",cookiebegin);
if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
cookiecontent = document.cookie.substring(cookiebegin,cookieend);
}
}
if(cookiecontent.length > 0) { return true; }
return false;
}

function SetCookie() {
var exp = '';
if(DaysToLive > 0) {
var now = new Date();
then = now.getTime() + (DaysToLive * 24 * 60 * 60 * 1000);
now.setTime(then);
exp = '; expires=' + now.toGMTString();
}
document.cookie = CookieName + '=' + Value + exp;
return true;
}

if(GetCookie() == true) { Action(); }

SetCookie();

Is it possible to remove this from my home page.
Photo of falkirks

falkirks

  • 12 Posts
  • 4 Reply Likes

Posted 7 years ago

  • 1
Photo of falkirks

falkirks

  • 12 Posts
  • 4 Reply Likes
I changed the variables.
Photo of Francois

Francois, Employee

  • 282 Posts
  • 19 Reply Likes
Hi NoahH,

I noticed that you state you have changed the variables. Can you please confirm that you would like us to proceed with the deletion of the above code from your page(s), or has the problem been resolved after the changes to the variables?

If you'd like for us to delete the code, can you please also let us know which page the code is on?

I look forward to your reply.
Photo of falkirks

falkirks

  • 12 Posts
  • 4 Reply Likes
The redirect seems to stop redirecting now and i have managed to delete it.