Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Я в тупике ,не могу найти ошибку. Помогите плз / 4 сообщений из 4, страница 1 из 1
09.06.2008, 22:28
    #35365771
StrangeRRR
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Я в тупике ,не могу найти ошибку. Помогите плз
Ошибка : missing ; before statement
указывает на эту строку :
link_del = '<a href="offline.php?user_id='+user_id+'" id=del'+user_id+' ...


function showUsers(){

var count_users = 0;
var wait_string = '';

url = 'getusers.php';

req1 = get_http();

req1.onreadystatechange = function(){


if(req1.readyState == 4){

document.getElementById("active_users").innerHTML = '';

var resp = req1.responseXML;

var cur = resp.getElementsByTagName( 'user' );

for( var i = 0; i < cur.length; i++ ){

var c = cur .childNodes;

var link_del = '';

for (var j=0; j < c.length; j++){


if(c[j].firstChild){


if(c[j].nodeName == 'username'){
document.getElementById("active_users").innerHTML += wait_string+ ' ' + c[j].firstChild.nodeValue;
}
if(c[j].nodeName == 'user_id'){
count_users++;
user_id = c[j].firstChild.nodeValue;
link_del = '<a href="offline.php?user_id='+user_id+'" id=del'+user_id+' onclick="del_user(this.href); openedWin['+user_id+'] = ''; return false;" class="del">[-]</a>';
}

if(c[j].nodeName == 'chat_id'){

chat_id = c[j].firstChild.nodeValue;
}
if(c[j].nodeName == 'ip'){

document.getElementById("active_users").innerHTML += ' <span class="ip"> ' + c[j].firstChild.nodeValue;+ '</span> ';
}
}


}

if(!openedWin[user_id] && count_users <= 5){
//alert('open window user_id->'+user_id);
openedWin[user_id] = open('chatsmall.php?chat_id='+chat_id + '&client_id='+user_id, "propop"+chat_id, "screenX=30,screenY=30,left=30,top=30, width=600,height=600,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0");
}

if(count_users >= 1){

wait_string = '--';

}

document.getElementById("active_users").innerHTML += link_del + "<br />";

}
}
}
req1.open("GET", url, true);
req1.send(null);

}
...
Рейтинг: 0 / 0
09.06.2008, 22:36
    #35365780
vkle
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Я в тупике ,не могу найти ошибку. Помогите плз
На первый взгляд, нарушена парность кавычек в указанной строке. Точней, закрывающая кавычка слишком рано.

PS: плиз, используйте тэг [ src ] для оформления кода.
Posted via ActualForum NNTP Server 1.4
...
Рейтинг: 0 / 0
09.06.2008, 22:45
    #35365791
StrangeRRR
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Я в тупике ,не могу найти ошибку. Помогите плз
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
function showUsers(){
	
	var count_users =  0 ;
	var wait_string = '';
	
	url = 'getusers.php';
	
	req1 = get_http();

	req1.onreadystatechange = function(){


    if(req1.readyState ==  4 ){
	
		document.getElementById("active_users").innerHTML = '';
		
		var resp = req1.responseXML;
		
		var cur  = resp.getElementsByTagName( 'user' );
		
		for( var i =  0 ; i < cur.length; i++ ){

			var c = cur[i].childNodes;
			
			var link_del = '';
							
			for (var j= 0 ; j < c.length; j++){
				
						
				if(c[j].firstChild){
					  
					
					  if(c[j].nodeName == 'username'){
					  	document.getElementById("active_users").innerHTML += wait_string+ '  ' + c[j].firstChild.nodeValue;
      	          	  }
					  if(c[j].nodeName == 'user_id'){
						 count_users++;
						 user_id = c[j].firstChild.nodeValue;
						 link_del =  '<a href="offline.php?user_id='+user_id+'" id=del'+user_id+' onclick="del_user(this.href); openedWin['+user_id+'] = ''; return false;" class="del">[-]</a>';
					  }
					  
					   if(c[j].nodeName == 'chat_id'){
					  	
						 chat_id = c[j].firstChild.nodeValue;
					  }
					  if(c[j].nodeName == 'ip'){
					  	
						 document.getElementById("active_users").innerHTML += ' <span class="ip"> ' + c[j].firstChild.nodeValue;+ '</span> ';
					  }
				}
      	            

			}
			
			if(!openedWin[user_id] && count_users <=  5 ){
				//alert('open window user_id->'+user_id);
				openedWin[user_id] = open('chatsmall.php?chat_id='+chat_id + '&client_id='+user_id, "propop"+chat_id, "screenX=30,screenY=30,left=30,top=30, width=600,height=600,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0");
			}
			
			if(count_users >=  1 ){
				
				wait_string = '--';
		
			}
			
			document.getElementById("active_users").innerHTML += link_del + "<br />";
			
	    }
	}
   }
	req1.open("GET", url, true);
    req1.send(null);

}

...
Рейтинг: 0 / 0
09.06.2008, 22:53
    #35365798
StrangeRRR
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Я в тупике ,не могу найти ошибку. Помогите плз
вместо
Код: plaintext
openedWin['+user_id+'] = '';
поставил
Код: plaintext
openedWin['+user_id+'] = \"\";
вроде помогло =)
Спасибо за слова про кавычки =)
...
Рейтинг: 0 / 0
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Я в тупике ,не могу найти ошибку. Помогите плз / 4 сообщений из 4, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]