ciao a tutti
sto riscontrando un problema in uno script jquery

ci tengo a precisare che già ho fatto mille prove
il problema è scriptaculos, se lo escludo funziona tutto bene, altrimenti non funziona lo script in jquery


inoltre sottolineo che utilizzo jquery noconflic che mi ha sempre elaborato bene sia jquery sia scriptaculos


ora in questo caso io ho già modificato tutte le $ in JQ nello script in questione

ma mi da un errore: uncaught exception Syntax error, unrecognized expression

ora cercando in giro ho trovato questo http://www.andreacardinali.it/risolv...ession-jquery/


che dice

codice:
 $(' a[href$=.jpeg] , a[href$=gif]')

Il fix del problema è facile, basta infatti aggiungere gli apici dopo il selettore:

$('a[href$=".jpeg"] , a[href$="gif"]')

io l'ho fatto (spero bene), e l'errore è sparito, ma nonostante ciò non mi funziona lo script


ora ho tolto questa modifica,ho provato a togliere scriptaculos e tutto funziona

vi posto il codice
qualcuno riesce a trovare l'errore?
ripeto cosi comè insieme a scriptaculos mi da questo errore
: uncaught exception Syntax error, unrecognized expression

VE lo posto in 2 pagine perchè tutto non ci va
ciao e grazie


ho la versione jQuery JavaScript Library v1.5.1
codice:

var windowFocus = true;
var username;
var chatHeartbeatCount = 0;
var minChatHeartbeat = 1000;
var maxChatHeartbeat = 33000;
var chatHeartbeatTime = minChatHeartbeat;
var originalTitle;
var blinkOrder = 0;

var chatboxFocus = new Array();
var newMessages = new Array();
var newMessagesWin = new Array();
var chatBoxes = new Array();

JQ(document).ready(function(){
	originalTitle = document.title;
	startChatSession();

	JQ([window, document]).blur(function(){
		windowFocus = false;
	}).focus(function(){
		windowFocus = true;
		document.title = originalTitle;
	});
});

function restructureChatBoxes() {
	align = 0;
	for (x in chatBoxes) {
		chatboxtitle = chatBoxes[x];

		if (JQ("#chatbox_"+chatboxtitle).css('display') != 'none') {
			if (align == 0) {
				JQ("#chatbox_"+chatboxtitle).css('right', '20px');
			} else {
				width = (align)*(225+7)+20;
				JQ("#chatbox_"+chatboxtitle).css('right', width+'px');
			}
			align++;
		}
	}
}

function chatWith(chatuser) {
	createChatBox(chatuser);
	JQ("#chatbox_"+chatuser+" .chatboxtextarea").focus();
}

function createChatBox(chatboxtitle,minimizeChatBox) {
	if (JQ("#chatbox_"+chatboxtitle).length > 0) {
		if (JQ("#chatbox_"+chatboxtitle).css('display') == 'none') {
			JQ("#chatbox_"+chatboxtitle).css('display','block');
			restructureChatBoxes();
		}
		JQ("#chatbox_"+chatboxtitle+" .chatboxtextarea").focus();
		return;
	}

	JQ(" <div />" ).attr("id","chatbox_"+chatboxtitle)
	.addClass("chatbox")
	.html('<div class="chatboxhead"><div class="chatboxtitle">'+chatboxtitle+'</div><div class="chatboxoptions">- X</div><br clear="all"/></div><div class="chatboxcontent"></div><div class="chatboxinput"><textarea class="chatboxtextarea" onkeydown="javascript:return checkChatBoxInputKey(event,this,\''+chatboxtitle+'\');"></textarea></div>')
	.appendTo(JQ( "body" ));
			   
	JQ("#chatbox_"+chatboxtitle).css('bottom', '0px');
	
	chatBoxeslength = 0;

	for (x in chatBoxes) {
		if (JQ("#chatbox_"+chatBoxes[x]).css('display') != 'none') {
			chatBoxeslength++;
		}
	}

	if (chatBoxeslength == 0) {
		JQ("#chatbox_"+chatboxtitle).css('right', '20px');
	} else {
		width = (chatBoxeslength)*(225+7)+20;
		JQ("#chatbox_"+chatboxtitle).css('right', width+'px');
	}
	
	chatBoxes.push(chatboxtitle);

	if (minimizeChatBox == 1) {
		minimizedChatBoxes = new Array();

		if (JQ.cookie('chatbox_minimized')) {
			minimizedChatBoxes = JQ.cookie('chatbox_minimized').split(/\|/);
		}
		minimize = 0;
		for (j=0;j<minimizedChatBoxes.length;j++) {
			if (minimizedChatBoxes[j] == chatboxtitle) {
				minimize = 1;
			}
		}

		if (minimize == 1) {
			JQ('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display','none');
			JQ('#chatbox_'+chatboxtitle+' .chatboxinput').css('display','none');
		}
	}

	chatboxFocus[chatboxtitle] = false;

	JQ("#chatbox_"+chatboxtitle+" .chatboxtextarea").blur(function(){
		chatboxFocus[chatboxtitle] = false;
		JQ("#chatbox_"+chatboxtitle+" .chatboxtextarea").removeClass('chatboxtextareaselected');
	}).focus(function(){
		chatboxFocus[chatboxtitle] = true;
		newMessages[chatboxtitle] = false;
		JQ('#chatbox_'+chatboxtitle+' .chatboxhead').removeClass('chatboxblink');
		JQ("#chatbox_"+chatboxtitle+" .chatboxtextarea").addClass('chatboxtextareaselected');
	});

	JQ("#chatbox_"+chatboxtitle).click(function() {
		if (JQ('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display') != 'none') {
			JQ("#chatbox_"+chatboxtitle+" .chatboxtextarea").focus();
		}
	});

	JQ("#chatbox_"+chatboxtitle).show();
}


function chatHeartbeat(){

	var itemsfound = 0;
	
	if (windowFocus == false) {
 
		var blinkNumber = 0;
		var titleChanged = 0;
		for (x in newMessagesWin) {
			if (newMessagesWin[x] == true) {
				++blinkNumber;
				if (blinkNumber >= blinkOrder) {
					document.title = x+' says...';
					titleChanged = 1;
					break;	
				}
			}
		}
		
		if (titleChanged == 0) {
			document.title = originalTitle;
			blinkOrder = 0;
		} else {
			++blinkOrder;
		}

	} else {
		for (x in newMessagesWin) {
			newMessagesWin[x] = false;
		}
	}

	for (x in newMessages) {
		if (newMessages[x] == true) {
			if (chatboxFocus[x] == false) {
				//FIXME: add toggle all or none policy, otherwise it looks funny
				JQ('#chatbox_'+x+' .chatboxhead').toggleClass('chatboxblink');
			}
		}
	}
	
	JQ.ajax({
	  url: "chat/chat.php?action=chatheartbeat",
	  cache: false,
	  dataType: "json",
	  success: function(data) {

		JQ.each(data.items, function(i,item){
			if (item)	{ // fix strange ie bug

				chatboxtitle = item.f;

				if (JQ("#chatbox_"+chatboxtitle).length <= 0) {
					createChatBox(chatboxtitle);
				}
				if (JQ("#chatbox_"+chatboxtitle).css('display') == 'none') {
					JQ("#chatbox_"+chatboxtitle).css('display','block');
					restructureChatBoxes();
				}
				
				if (item.s == 1) {
					item.f = username;
				}

				if (item.s == 2) {
					JQ("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxinfo">'+item.m+'</span></div>');
				} else {
					newMessages[chatboxtitle] = true;
					newMessagesWin[chatboxtitle] = true;
					JQ("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.f+':</span><span class="chatboxmessagecontent">'+item.m+'</span></div>');
				}

				JQ("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop(JQ("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
				itemsfound += 1;
			}
		});

		chatHeartbeatCount++;

		if (itemsfound > 0) {
			chatHeartbeatTime = minChatHeartbeat;
			chatHeartbeatCount = 1;
		} else if (chatHeartbeatCount >= 10) {
			chatHeartbeatTime *= 2;
			chatHeartbeatCount = 1;
			if (chatHeartbeatTime > maxChatHeartbeat) {
				chatHeartbeatTime = maxChatHeartbeat;
			}
		}
		
		setTimeout('chatHeartbeat();',chatHeartbeatTime);
	}});
}

function closeChatBox(chatboxtitle) {
	JQ('#chatbox_'+chatboxtitle).css('display','none');
	restructureChatBoxes();

	JQ.post("chat/chat.php?action=closechat", { chatbox: chatboxtitle} , function(data){	
	});

}

function toggleChatBoxGrowth(chatboxtitle) {
	if (JQ('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display') == 'none') {  
		
		var minimizedChatBoxes = new Array();
		
		if (JQ.cookie('chatbox_minimized')) {
			minimizedChatBoxes = JQ.cookie('chatbox_minimized').split(/\|/);
		}

		var newCookie = '';

		for (i=0;i<minimizedChatBoxes.length;i++) {
			if (minimizedChatBoxes[i] != chatboxtitle) {
				newCookie += chatboxtitle+'|';
			}
		}

		newCookie = newCookie.slice(0, -1)


		JQ.cookie('chatbox_minimized', newCookie);
		JQ('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display','block');
		JQ('#chatbox_'+chatboxtitle+' .chatboxinput').css('display','block');
		JQ("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop(JQ("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
	} else {
		
		var newCookie = chatboxtitle;

		if (JQ.cookie('chatbox_minimized')) {
			newCookie += '|'+JQ.cookie('chatbox_minimized');
		}


		JQ.cookie('chatbox_minimized',newCookie);
		JQ('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display','none');
		JQ('#chatbox_'+chatboxtitle+' .chatboxinput').css('display','none');
	}
	
}

function checkChatBoxInputKey(event,chatboxtextarea,chatboxtitle) {
	 
	if(event.keyCode == 13 && event.shiftKey == 0)  {
		message = JQ(chatboxtextarea).val();
		message = message.replace(/^\s+|\s+$/g,"");

		JQ(chatboxtextarea).val('');
		JQ(chatboxtextarea).focus();
		JQ(chatboxtextarea).css('height','44px');
		if (message != '') {
			JQ.post("chat/chat.php?action=sendchat", {to: chatboxtitle, message: message} , function(data){
				message = message.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");
				JQ("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+username+':</span><span class="chatboxmessagecontent">'+message+'</span></div>');
				JQ("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop(JQ("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
			});
		}
		chatHeartbeatTime = minChatHeartbeat;
		chatHeartbeatCount = 1;

		return false;
	}

	var adjustedHeight = chatboxtextarea.clientHeight;
	var maxHeight = 94;

	if (maxHeight > adjustedHeight) {
		adjustedHeight = Math.max(chatboxtextarea.scrollHeight, adjustedHeight);
		if (maxHeight)
			adjustedHeight = Math.min(maxHeight, adjustedHeight);
		if (adjustedHeight > chatboxtextarea.clientHeight)
			JQ(chatboxtextarea).css('height',adjustedHeight+8 +'px');
	} else {
		JQ(chatboxtextarea).css('overflow','auto');
	}
	 
}

function startChatSession(){  
	JQ.ajax({
	  url: "chat/chat.php?action=startchatsession",
	  cache: false,
	  dataType: "json",
	  success: function(data) {