Astrophysist301 Astrophysist301 - 3 months ago 13
CSS Question

How come I keep getting a Failed to load resource: Error everytime I run my applacation?

I made a evolution calculator and I keep coming up with this Error
The basics of the code is basically you click the button and the computer prompts you twice and multiplies something according to what the user answers to the prompt...I'm fairly new to html so..
Here is my html code

<!DOCTYPE HTML>
<html>
<head>
<title>Pokemon GO evolution calculator </title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<a href="#" class ="button button-primary" style ="color:white" onclick="var evo = prompt('What Pokemon Do you want to evolve?'); var cp = prompt('How Much CP Does your Pokemon Have?');
evo.toLowerCase();
if (evo == 'bulbasaur'){
var multipler = 1.555;
var answer = multipler * cp;
var evoName = 'Ivysaur';
}
else if (evo == 'ivysaur'){
var multipler = 1.405;
var answer = multipler * cp;
var evoName = 'Venasaur';
}
else if (evo == 'charmander'){
var multipler = 1.67;
var answer = multipler * cp;
var evoName = 'Charmeleon';
}

else if (evo == 'charmeleon'){
var multipler = 1.72;
var answer = multipler * cp;
var evoName = 'Charizard';
}
else if (evo == 'squirtle'){
var multipler = 1.645;
var answer = multipler * cp;
var evoName = 'Wartortle';
}
else if (evo == 'wartortle'){
var multipler = 1.525;
var answer = multipler * cp;
var evoName = 'Blastoise';
}
else if (evo == 'caterpie'){
var multipler = 1.06;
var answer = multipler * cp;
var evoName = 'Metapod';
}
else if (evo == 'metapod'){
var multipler = 3.655;
var answer = multipler * cp;
var evoName = 'Butterfree';
}
else if (evo == 'weedle'){
var multipler = 1.08;
var answer = multipler * cp;
var evoName = 'Kakuna';
}
else if (evo == 'kakuna'){
var multipler = 3.36;
var answer = multipler * cp;
var evoName = 'Beedrill';
}
else if (evo == 'pidgey'){
var multipler = 1.885;
var answer = multipler * cp;
var evoName = 'pidgeotto';
}
else if (evo == 'pidgeotto'){
var multipler = 1.755;
var answer = multipler * cp;
var evoName = 'Pidgeot';
}
else if (evo == 'rattata'){
var multipler = 2.67;
var answer = multipler * cp;
var evoName = 'Raticate';
}
else if (evo == 'spearow'){
var multipler = 2.695;
var answer = multipler * cp;
var evoName = 'Fearow';
}
else if (evo == 'ekans'){
var multipler = 2.265;
var answer = multipler * cp;
var evoName = 'Arbok';
}
else if (evo == 'pikachu'){
var multipler = 2.355;
var answer = multipler * cp;
var evoName = 'Raichu';
}
else if (evo == 'sandshrew'){
var multipler = 2.555;
var answer = multipler * cp;
var evoName = 'Sandslash';
}
else if (evo == 'nidoran'){
var multipler = 1.64;
var answer = multipler * cp;
var evoName = 'Nidorina';
}
else if (evo == 'nidorina'){
var multipler = 1.92;
var answer = multipler * cp;
var evoName = 'Nidoqueen';
}
else if (evo == 'nidoran'){
var multipler = 1.675;
var answer = multipler * cp;
var evoName = 'Nidorino';
}
else if (evo == 'nidorino'){
var multipler = 1.75;
var answer = multipler * cp;
var evoName = 'Nidoking';
}
else if (evo == 'clefairy'){
var multipler = 2.11;
var answer = multipler * cp;
var evoName = 'Clefable';
}
else if (evo == 'vulpix'){
var multipler = 2.71;
var answer = multipler * cp;
var evoName = 'Ninetales';
}
else if (evo == 'jigglypuff'){
var multipler = 2.44;
var answer = multipler * cp;
var evoName = 'Wigglytuff';
}
else if (evo == 'zubat'){
var multipler = 3.115;
var answer = multipler * cp;
var evoName = 'Golbat';
}
else if (evo == 'oddish'){
var multipler = 1.495;
var answer = multipler * cp;
var evoName = 'gloom';
}
else if (evo == 'gloom'){
var multipler = 1.505;
var answer = multipler * cp;
var evoName = 'Vilepume';
}
else if (evo == 'paras'){
var multipler = 1.97;
var answer = multipler * cp;
var evoName = 'Parsect';
}
else if (evo == 'venonat'){
var multipler = 1.875;
var answer = multipler * cp;
var evoName = 'Venomoth';
}
else if (evo == 'diglett'){
var multipler = 1.875;
var answer = multipler * cp;
var evoName = 'Dugtrio';
}
else if (evo == 'meowth'){
var multipler = 2.11;
var answer = multipler * cp;
var evoName = 'meowth';
}
else if (evo == 'psyduck'){
var multipler = 2.255;
var answer = multipler * cp;
var evoName = 'Golduck';
}
else if (evo == 'mankey'){
var multipler = 2.215;
var answer = multipler * cp;
var evoName = 'Primeape';
}
else if (evo == 'growlithe'){
var multipler = 2.305;
var answer = multipler * cp;
var evoName = 'Arcanine';
}
else if (evo == 'poliwag'){
var multipler = 1.805;
var answer = multipler * cp;
var evoName = 'Poliwhirl';
}
else if (evo == 'poliwhirl'){
var multipler = 1.93;
var answer = multipler * cp;
var evoName = 'Poliwrath';
}
else if (evo == 'abra'){
var multipler = 1.68;
var answer = multipler * cp;
var evoName = 'Kadabra';
}
else if (evo == 'kadabra'){
var multipler = 1.53;
var answer = multipler * cp;
var evoName = 'Alkazam';
}
else if (evo == 'machop'){
var multipler = 1.645;
var answer = multipler * cp;
var evoName = 'Machoke';
}
else if (evo == 'machoke'){
var multipler = 1.59;
var answer = multipler * cp;
var evoName = 'Machamp';
}
else if (evo == 'bellsprout'){
var multipler = 1.57;
var answer = multipler * cp;
var evoName = 'Weepinbell';
}
else if (evo == 'weepinbell'){
var multipler = 1.495;
var answer = multipler * cp;
var evoName = 'Victreebel';
}
else if (evo == 'Tentacool'){
var multipler = 2.535;
var answer = multipler * cp;
var evoName = 'Tentacruel';
}
else if (evo == 'geodude'){
var multipler = 1.735;
var answer = multipler * cp;
var evoName = 'Graveler';
}
else if (evo == 'Graveler'){
var multipler = 1.675;
var answer = multipler * cp;
var evoName = 'Golem';
}
else if (evo == 'ponyta'){
var multipler = 1.535;
var answer = multipler * cp;
var evoName = 'Rapidash';
}
else if (evo == 'slowpoke'){
var multipler = 2.2;
var answer = multipler * cp;
var evoName = 'Slowbro';
}
else if (evo == 'magnemite'){
var multipler = 2.18;
var answer = multipler * cp;
var evoName = 'Magneton';
}
else if (evo == 'doduo'){
var multipler = 2.175;
var answer = multipler * cp;
var evoName = 'Dugtrio';
}
else if (evo == 'seel'){
var multipler = 1.995;
var answer = multipler * cp;
var evoName = 'Dewgong';
}
else if (evo == 'grimer'){
var multipler = 2.1;
var answer = multipler * cp;
var evoName = 'Muk';
}
else if (evo == 'shellder'){
var multipler = 2.635;
var answer = multipler * cp;
var evoName = 'Cloyster';
}
else if (evo == 'gastly'){
var multipler = 1.79;
var answer = multipler * cp;
var evoName = 'Haunter';
}
else if (evo == 'haunter'){
var multipler = 1.665;
var answer = multipler * cp;
var evoName = 'Gengar';
}
else if (evo == 'krabby'){
var multipler = 2.375;
var answer = multipler * cp;
var evoName = 'Kingler';
}
else if (evo == 'voltorb'){
var multipler = 2.02;
var answer = multipler * cp;
var evoName = 'Electrode';
}
else if (evo == 'exeggcute'){
var multipler = 2.94;
var answer = multipler * cp;
var evoName = 'Exeggutor';
}
else if (evo == 'cubone'){
var multipler = 1.66;
var answer = multipler * cp;
var evoName = 'Marowak';
}
else if (evo == 'koffing'){
var multipler = 2.025;
var answer = multipler * cp;
var evoName = 'Weezing';
}
else if (evo == 'rhyhorn'){
var multipler = 1.905;
var answer = multipler * cp;
var evoName = 'Rhydon';
}
else if (evo == 'Horsea'){
var multipler = 2.21;
var answer = multipler * cp;
var evoName = 'Seadra';
}
else if (evo == 'Goldeen'){
var multipler = 2.19;
var answer = multipler * cp;
var evoName = 'Seaking';
}
else if (evo == 'Staryu'){
var multipler = 2.395;
var answer = multipler * cp;
var evoName = 'Starmie';
}
else if (evo == 'magikarp'){
var multipler = 11.03;
var answer = multipler * cp;
var evoName = 'Gyarados';
}
else if (evo == 'omanyte'){
var multipler = 2.055;
var answer = multipler * cp;
var evoName = 'Omasters';
}
else if (evo == 'kabuto'){
var multipler = 2.17;
var answer = multipler * cp;
var evoName = 'Kabutops';
}
else if (evo == 'dratini'){
var multipler = 1.825;
var answer = multipler * cp;
var evoName = 'Dragonair';
}
else if (evo == 'dragonair'){
var multipler = 1.825;
var answer = multipler * cp;
var evoName = 'Dragonite';
}
else if (evo == 'Eevee'){
var Eevolution = prompt('Which Eevee lution do you want?');
Eevolution.toUpperCase();
if(Eevolution == 'vaporeon'){
var multipler = 2.645;
var answer = multipler * cp;
var evoName = 'Vaporeon';
}
else if(Eevolution == 'flareon'){
var multipler = 2.55;
var answer = multipler * cp;
var evoName = 'Flareon';
}
else if(Eevolution == 'jolteon'){
var multipler = 2.05;
var answer = multipler * cp;
var evoName = 'Jolteon';
}
}
alert(evoName + ' will have ' + answer + ' cp');">Generate Evolution CP</a>
</body>
</html>


CSS

body, input, button{
font: 14px "Arial";
}


.button{
padding: 8px 16px;
display:inline-block;
text-decoration: none;
border-radius:3px;


}
.button-primary{
background:#0066cc;
color:darkblue;
}
.button-primary:hover {
background:#33ccff;
}

Answer

Your error just says that there is no favicon.ico on your server. It's nothing related to your code. By default html looks for the favicon on the / and with the name favicon.ico. Since it doesn't find it, and you haven't declared to search for it on other path and/or with another name, it throws in that 404 error on console. More information about why to specify it can be found here.

Just make sure you add a declaration or place a file there and you won't get that error anymore.

Besides that, your code seems to work correctly :)