Jump to content
php.lv forumi
  • 0

IE piesienas praktiski tukšai rindai!


Question

Posted

uz FF viss ok, bet IE ieķerās 35 rindas 4 charā (error expected identifier, string or number: code 800A0404)

35 rinda ir :" });"

/* 
Created by: Kenrick Beckett

Name: Chat Engine
*/

var instanse = false;
var state;
var mes;
var file;

function Chat () {
   this.update = updateChat;
   this.send = sendChat;
this.getState = getStateOfChat;
}

//gets the state of the chat
function getStateOfChat(){
if(!instanse){
	 instanse = true;
	 $.ajax({
		   type: "POST",
		   url: "process.php",
		   data: {  
		   			'function': 'getState',
					'file': file
					},
		   dataType: "json",

		   success: function(data){
			   state = data.state;
			   instanse = false;
		   },
		});
}	 
}

//Updates the chat
function updateChat(){
 if(!instanse){
	 instanse = true;
     $.ajax({
		   type: "POST",
		   url: "process.php",
		   data: {  
		   			'function': 'update',
					'state': state,
					'file': file
					},
		   dataType: "json",
		   success: function(data){
			   if(data.text){
					for (var i = 0; i < data.text.length; i++) {
                           $('#chat-area').append($("<p>"+ data.text[i] +"</p>"));
                       }								  
			   }
			   document.getElementById('chat-area').scrollTop = document.getElementById('chat-area').scrollHeight;
			   instanse = false;
			   state = data.state;
		   },
		});
 }
 else {
	 setTimeout(updateChat, 1500);
 }
}

//send the message
function sendChat(message, nickname)
{       
   updateChat();
    $.ajax({
	   type: "POST",
	   url: "process.php",
	   data: {  
	   			'function': 'send',
				'message': message,
				'nickname': nickname,
				'file': file
			 },
	   dataType: "json",
	   success: function(data){
		   updateChat();
	   },
	});
}

5 answers to this question

Recommended Posts

  • 0
Posted

ok, topiku dzēst nevaru, vainīga bija iepriekšejā rinda, kurā stāv "},"

maz ko saprotu no JS, un kādu apsvērumu dēļ autors to "," tur iebāza - nezinu, bet bez tā viss labi strādā arī uz IE

  • 0
Posted

vainīga bija iepriekšejā rinda, kurā stāv "},"

maz ko saprotu no JS,

Nav svrigi kaada valoda ( kautvai Latvieshu ), ja tiek veidots bloks tad - IEKAVAM JABUUT NOSLEGTAM !!!

taa kaa, nakamreiz panjem kaadu sakariigu Text redaktoru, kas paraadis kad nav noslegas kadas no iekavaam ..

  • 0
Posted (edited)

IE ir problēma ar tukšiem objektu elementiem, tas ir, nevar atstāt {"one":1,"two":2,} ar komatu beigās, vajag {"one":1,"two":2}

Cik skatos, kodā tas komats ir salikts visos objektos beigās.

Edited by indoom
  • 0
Posted

Nav svrigi kaada valoda ( kautvai Latvieshu ), ja tiek veidots bloks tad - IEKAVAM JABUUT NOSLEGTAM !!!

taa kaa, nakamreiz panjem kaadu sakariigu Text redaktoru, kas paraadis kad nav noslegas kadas no iekavaam ..

iekavas bija noslēgtas (skaties divreiz, divreiz!) vainīgs bija ,

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...