Quantcast

Jump to content


Photo

What is wrong with this switch case?


  • Please log in to reply
1 reply to this topic

#1 Metigue

Metigue
  • 689 posts

Posted 15 November 2010 - 10:23 AM

function refresh() { switch (GM_getValue('$x', '')) {

case "0": 
if (window.find(":53")) { 
			window.location.reload();
						}
	break;

case "1": 
if (window.find(":10")) {
        window.setTimeout( function() { 
	GM_setValue('$x', '2');
	window.location.reload(); }, 383000);
        }
	break;
case "2":
if (window.find(":53")) {
	GM_setValue('$x', '1');
	window.location.reload(); 
					}
	break;
default:
	GM_setValue('$x', '0');
	go();
	break;
     }
      }

:/ There must be a syntax error because it's not compiling the function, but I can't seem to find it.

#2 Pyro699

Pyro699
  • 1543 posts


Users Awards

Posted 15 November 2010 - 10:33 AM

I went through your code, and fixed the tabbing so i could see it easier... but i could not find any syntax errors (i do know javascript)... The only thing i can think of is somewhere in the neopets pages, its finding ":10" and the timeout was engaged...

Fixed Tabs:
Spoiler


~Cody


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users