This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Control Flow: Switch Forum

View Course

115 points
5a3a5c2a6299fbe60be63d85d072482d?s=140&d=retro
Submitted by
K.C. Jones
almost 2 years ago

Page just keeps loading

I entered a code and went back to check the syntax. When I came back to the page, half the code I had put in was there and the page just sits there trying to load with the progress circle thing in the middle, but never finishes and I can't go any farther.

Here is the code:

<!DOCTYPE html>





<?php
$bleh = "Tara";
switch($bleh) {
case(Erica):
echo "ex-girlfriend";
break;
case(Tara):
echo "
?>

and it looks like not all the code is displaying, but that's what shows on my screen and it will not finish loading. If someone could reset the page or the whole lesson even...I would appreciate it!

GREAT site by the way!!!
Thanks!!


0 votes

permalink

I'm encountering the same thing in 1/6. What I theorize is happening, based on behavior I observed in earlier lessons, is that the display window that parses your PHP and outputs the results is dynamically refreshing as you type code. Because of this, based on where my code stalled out (I had completed my loop, but when I refreshed, a bit was missing, and what was left would be an infinite case), I think it's possible (especially while constructing switches and loops) for your code to be in a state that would cause an infinite loop at the moment the display attempts to parse your code, causing an infinite load. Just a theory.

I've tried all the standard "Break" key-combinations I can think of, and the best I can do is make the aero stop spinning. I've yet to figure out how to recover the lesson.

748 points
3e00fbae3934889c7765761428b7b976?s=140&d=retro
Submitted by
RJeter81
almost 2 years ago

1 Comment

5a3a5c2a6299fbe60be63d85d072482d?s=140&d=retro K.C. Jones almost 2 years ago

yeah that's kind of what I was thinking as well. I had completed the code, but there was still something I was missing, so I hit the back button to check the code and when I came back, only part of the code was displaying and the infinite loop happened. Probably have to open another account with a different email and try again just to get past this lesson unless they can reset it or something.


0 votes

permalink

I was able to un-freeze the lesson by going to the page on my mobile device and using the "Reset Code" button there. I then typed out the code I felt I needed to complete the lesson in Notepad++ and copy/pasted it successfully in to the lesson. I hope that helps.

748 points
3e00fbae3934889c7765761428b7b976?s=140&d=retro
Submitted by
RJeter81
almost 2 years ago

1 Comment

5a3a5c2a6299fbe60be63d85d072482d?s=140&d=retro K.C. Jones almost 2 years ago

I'll give that a try! Thanks!


0 votes

permalink

well I feel a little embarrassed! lol I cleared the browser's cache and it worked fine afterwards. It did come up with an error in Chrome, so I opened it up in Microsoft Edge and it had no issues.
So clear your cache out if you have this issue! :)

115 points
5a3a5c2a6299fbe60be63d85d072482d?s=140&d=retro
Submitted by
K.C. Jones
almost 2 years ago

1 Comment

3e00fbae3934889c7765761428b7b976?s=140&d=retro RJeter81 almost 2 years ago

And if it gets hard stuck with the darkened screen and the loading aero on it, you can right click, select Inspect Element (I sometimes have to do this twice), and if you end up in a highlighted div container that says something about "overlays", right click on that and Delete Element. Then you can enter your code, refresh the screen once, and should be on your way.


0 votes

permalink

My solution is to type the php code into a text editor like notepad++ and then copy my finished code into the answer box. There seems to be a problem with parser.

793 points
54e05f89937676d117005fbf_950379676
Submitted by
smokeyjones
almost 2 years ago