I need help loading

div supposed to be loading when page load but its stuck at 20%

2 Likes

// Loading script version 1
function myThing() {
document.getElementById(“man”).innerHTML = “10%”
console.log(“Passed 1!”)
setTimeout(reDi, 1000)
}
function reDi() {
document.getElementById(“man”).innerHTML = “20%”
console.log(“Passed 2!”)
setTimeout(thRee, 1000)
}
function thRee() {
document.getElementById(“man”).innerHTML = “30%”
console.log(“Passed 3!”)
setTimeout(fOur, 2000)
}
function fOur() {
document.getElementById(“man”).innerHTML = “40%”
console.log(“Passed 1!”)
setTimeout(fIth, 1000)
}
function fIth() {
document.getElementById(“man”).innerHTML = “50%”
console.log(“Passed 1!”)
setTimeout(sIx, 1000)
}
function sIx() {
document.getElementById(“man”).innerHTML = “60%”
console.log(“Passed 1!”)
setTimeout(sEven, 1000)
}
function sEven() {
document.getElementById(“man”).innerHTML = “70%”
console.log(“Passed 1!”)
setTimeout(eIght, 1000)
}
function eIght() {
document.getElementById(“man”).innerHTML = “87%”
console.log(“Passed 1!”)
setTimeout(nIne, 4000)
}
function nIne() {
document.getElementById(“man”).innerHTML = “91%”
console.log(“Passed 1!”)
setTimeout(oNe, 5000)
}
function oNe() {
document.getElementById(“man”).innerHTML = “100%”
console.log(“Passed 1!”)
setTimeout(loDed, 2000)
}
function loDed() {
document.getElementById(“man”).style.color = “yellow”;
document.getElementById(“man”).innerHTML = “Server Connecting Success!”
console.log(“Redirecting…!”)
setTimeout(loAd, 1000)
}
function loAd() {
console.log(“checking…”)
window.location.replace(“Discord”);
console.log(“Done!”)
}

function sKip() {
window.location.replace(“http://www.discord.com”);
}
// new Script Mother of scipt
console.log(“Passed”)
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (“;”, offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + “=”;
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" “, i) + 1;
if (i == 0)
break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (2 < argc) ? argv[2] : null;
var path = (3 < argc) ? argv[3] : null;
var domain = (4 < argc) ? argv[4] : null;
var secure = (5 < argc) ? argv[5] : false;
document.cookie = name + “=” + escape (value) +
((expires == null) ? “” : (”; expires=" + expires.toGMTString())) +
((path == null) ? “” : (“; path=” + path)) +
((domain == null) ? “” : (“; domain=” + domain)) +
((secure == true) ? “; secure” : “”);
}
function DisplayInfo() {
var expdate = new Date();
var visit;
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
if(!(visit = GetCookie(“visit”)))
visit = 0;
visit++;
SetCookie(“visit”, visit, expdate, “/”, null, false);
var message;
if(visit == 1)
message=" Welcome to my idk!“;
if(visit== 2)
message=” I see you came back !“;
if(visit == 3)
message=” Oh, it’s you again!“;
if(visit == 4)
message=” You must be curious!“;
if(visit == 5)
message=” You’re practically a regular!“;
if(visit == 6)
message=” You need a hobby!“;
if(visit == 7)
message=” Nothing better to do?“;
if(visit == 8)
message=” Don’t you ever sleep?“;
if(visit == 9)
message=” Get a life!!!“;
if(visit >= 10)
message=” Rent is due on the 1st of the month!“;
document.getElementById(“kNo”).innerHTML = (”\n"+“Your browser has visited this page \n”
+" “+visit+”\n"
+" time(s).“+”\n"+“\n”
+message)
}
function ResetCounts() {
var expdate = new Date();
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
visit = 0;
SetCookie(“visit”, visit, expdate , “/”, null, false);
history.go(0);
}

window.onload=DisplayInfo
console.log(“Clean”)
// header
function informationbar(){
this.displayfreq=“always”
this.content=‘
}

informationbar.prototype.setContent=function(data){
this.content=this.content+data
document.write(‘

’+this.content+‘
’)
}

informationbar.prototype.animatetoview=function(){
var barinstance=this
if (parseInt(this.barref.style.top)<0){
this.barref.style.top=parseInt(this.barref.style.top)+5+“px”
setTimeout(function(){barinstance.animatetoview()}, 50)
}
else{
if (document.all && !window.XMLHttpRequest)
this.barref.style.setExpression(“top”, ‘document.compatMode==“CSS1Compat”? document.documentElement.scrollTop+“px” : body.scrollTop+“px”’)
else
this.barref.style.top=0
}
}

informationbar.close=function(){
document.getElementById(“informationbar”).style.display=“none”
if (this.displayfreq==“session”)
document.cookie=“infobarshown=1;path=/”
}

informationbar.prototype.setfrequency=function(type){
this.displayfreq=type
}

informationbar.prototype.initialize=function(){
if (this.displayfreq==“session” && document.cookie.indexOf(“infobarshown”)==-1 || this.displayfreq==“always”){
this.barref=document.getElementById(“informationbar”)
this.barheight=parseInt(this.barref.offsetHeight)
this.barref.style.top=this.barheight*(-1)+“px”
this.animatetoview()
}
}

window.onunload=function(){
this.barref=null
}
console.log(“Ok”)
// header part 2

var infobar=new informationbar()
infobar.setContent(‘Welcome to Loading! It appears you are not registered yet on our site. Why wait? Register here’)
infobar.initialize()

2 Likes

html:

loading


20%

2 Likes

Hi @ChaseClift, it would be much easier to help if you sent the url of your website!

2 Likes

https://loadingtest.chaseclift.repl.co/

2 Likes

The page appears to be loading fine for me, could you try to describe your issue a bit more in depth, thanks!

2 Likes

there supposed to be a lading div and when it’s finished it’ll rick roll you

2 Likes

I see this:

I assume that clicking on the link to Register here will rick roll you.

2 Likes

yes but there will be a div that will load and redirect rick rolls u but the div is gone

2 Likes

Hi @ChaseClift I can’t help you here as I can’t see the Replit with your code, just the website.

If you can post a link to the Replit here maybe we can help.

2 Likes

idk why it’s not working i tried putting console.log(“ ”) and it seems fine But it’s not loading here’s the code
JAVASCRIPT:

// Loading script version 1
function myThing() {
  document.getElementById("man").innerHTML = "10%"
 console.log("Passed 1!")
  setTimeout(reDi, 1000)
}
function reDi() {
  document.getElementById("man").innerHTML = "20%"
 console.log("Passed 2!")
  setTimeout(thRee, 1000)
}
function thRee() {
  document.getElementById("man").innerHTML = "30%"
 console.log("Passed 3!")
  setTimeout(fOur, 2000)
}
function fOur() {
  document.getElementById("man").innerHTML = "40%"
 console.log("Passed 1!")
  setTimeout(fIth, 1000)
}
function fIth() {
  document.getElementById("man").innerHTML = "50%"
 console.log("Passed 1!")
  setTimeout(sIx, 1000)
}
function sIx() {
  document.getElementById("man").innerHTML = "60%"
 console.log("Passed 1!")
  setTimeout(sEven, 1000)
}
function sEven() {
  document.getElementById("man").innerHTML = "70%"
 console.log("Passed 1!")
  setTimeout(eIght, 1000)
}
function eIght() {
  document.getElementById("man").innerHTML = "87%"
 console.log("Passed 1!")
  setTimeout(nIne, 4000)
}
function nIne() {
  document.getElementById("man").innerHTML = "91%"
 console.log("Passed 1!")
  setTimeout(oNe, 5000)
}
function oNe() {
  document.getElementById("man").innerHTML = "100%"
 console.log("Passed 1!")
  setTimeout(loDed, 2000)
}
function loDed() {
  document.getElementById("man").style.color = "yellow";
  document.getElementById("man").innerHTML = "Server Connecting Success!"
 console.log("Redirecting....!")
  setTimeout(loAd, 1000)
}
function loAd() {
  console.log("checking...")
window.location.replace("#”)
  console.log("Done!")
}

function sKip() {
window.location.replace("#l)
}
// new Script Mother of scipt
console.log("Passed")
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) 
break; 
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (2 < argc) ? argv[2] : null;
var path = (3 < argc) ? argv[3] : null;
var domain = (4 < argc) ? argv[4] : null;
var secure = (5 < argc) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DisplayInfo() {
var expdate = new Date();
var visit;
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
if(!(visit = GetCookie("visit"))) 
visit = 0;
visit++;
SetCookie("visit", visit, expdate, "/", null, false);
var message;
if(visit == 1) 
message="         Welcome to my idk!";
if(visit== 2) 
message="           I see you came back !";
if(visit == 3) 
message="               Oh, it's you again!";
if(visit == 4)
message="            You must be curious!"; 
if(visit == 5) 
message="      You're practically a regular!";
if(visit == 6) 
message="              You need a hobby!";
if(visit == 7)
message="             Nothing better to do?"; 
if(visit == 8) 
message="            Don't you ever sleep?";
if(visit == 9)
message="                      Get a life!!!"; 
if(visit >= 10) 
message="  Rent is due on the 1st of the month!";
  document.getElementById("kNo").innerHTML = ("\n"+"Your browser has visited this page               \n"
            +"                              "+visit+"\n"
            +"                          time(s)."+"\n"+"\n"
            +message)
}
function ResetCounts() {
var expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
visit = 0;
SetCookie("visit", visit, expdate , "/", null, false);
history.go(0);
}

window.onload=DisplayInfo
console.log("Clean")
// header 
function informationbar(){
	this.displayfreq="always"
	this.content='<a href="javascript:informationbar.close()"><img src="close.gif" style="width: 14px; height: 14px; float: right; border: 0; margin-right: 5px" /></a>'
}

informationbar.prototype.setContent=function(data){
	this.content=this.content+data
	document.write('<div id="informationbar" style="top: -500px">'+this.content+'</div>')
}

informationbar.prototype.animatetoview=function(){
	var barinstance=this
	if (parseInt(this.barref.style.top)<0){
		this.barref.style.top=parseInt(this.barref.style.top)+5+"px"
		setTimeout(function(){barinstance.animatetoview()}, 50)
	}
	else{
		if (document.all && !window.XMLHttpRequest)
		this.barref.style.setExpression("top", 'document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+"px" : body.scrollTop+"px"')
	else
		this.barref.style.top=0
	}
}

informationbar.close=function(){
	document.getElementById("informationbar").style.display="none"
	if (this.displayfreq=="session")
		document.cookie="infobarshown=1;path=/"
}

informationbar.prototype.setfrequency=function(type){
	this.displayfreq=type
}

informationbar.prototype.initialize=function(){
	if (this.displayfreq=="session" && document.cookie.indexOf("infobarshown")==-1 || this.displayfreq=="always"){
		this.barref=document.getElementById("informationbar")
		this.barheight=parseInt(this.barref.offsetHeight)
		this.barref.style.top=this.barheight*(-1)+"px"
		this.animatetoview()
	}
}

window.onunload=function(){
	this.barref=null
}
console.log("Ok")
// header part 2

var infobar=new informationbar()
infobar.setContent('Welcome to Loading! It appears you are not registered yet on our site. Why wait? <a href="https://m.youtube.com/watch?v=dQw4w9WgXcQ">Register here</a>')
infobar.initialize()

HTML:

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>loading</title>
  <link href="style.css" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" href="#”;
</head>

<body onload="move()">
<div class="w3-container">

<div class="w3-light-grey">
  <div id="myBar" class="w3-container w3-green" style="height:24px;width:20%"></div>
  </div>
<br><p></p><br><p></p>
  <center><p id="demo">20%</p>
<p id="kNo"></p>
  <!--<button class="w3-button w3-green" onclick="move()">Click Me</button> -->
</div>
</center>
  <script src="script.js"></script>

 <!--
  This script places a badge on your repl's full-browser view back to your repl's cover
  page. Try various colors for the theme: dark, light, red, orange, yellow, lime, green,
  teal, blue, blurple, magenta, pink!
  -->
 
</body>

</html>
2 Likes

Hi @ChaseClift thank you for your message.

Can you post a link to your Repl please so others in the community can see your code and suggest some ideas. Posting the listing as above isn’t helpful as we cannot see the error messages or understand what it is you are trying to do.

2 Likes

https://loadingtest.chaseclift.repl.co/

2 Likes

I’ve combined these posts as you have posted the same query twice.

2 Likes

@IanAtCSTeach https://loadingtest.chaseclift.repl.co/__repl

3 Likes

Hi @ChaseClift I’ve looked at the code and there isn’t a missing div, there is a missing CSS entry for the div class w3-light-grey. It is also positioned behind the information bar.

Can you explain in more detail what exactly you are having an issue with. A screen recording might help here.

2 Likes