Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> problem z pętlą while
dark_root
post 12.06.2010, 11:46:29
Post #1





Grupa: Zarejestrowani
Postów: 341
Pomógł: 1
Dołączył: 19.11.2007

Ostrzeżenie: (10%)
X----


Mam taki kod:
Kod
var url = String(window.location);
var index = url.indexOf("?");
var data = url.substr(index+1);
var number = data.split("&");
var x=0;
while(number[x].length >0)
{
alert(x);
alert(number[x]);
var splitted = number[x].split("=");
event = splitted[0];
act = splitted[1];
alert(event);
alert(act);
x++;
}
alert('sss');

Problem polega na tym, iż pętla while, jakby się nie kończyła tzn, skończy się wysyłanie alertów w tej pętli, jednak ostatnia linijka alert('sss') się nie wykonuje, dlaczego tak się dzieje?
Go to the top of the page
+Quote Post

Posty w temacie
- dark_root   problem z pętlą while   12.06.2010, 11:46:29


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 24.07.2025 - 17:03