Click here to Skip to main content
15,922,015 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: problem with frame levels Pin
Bradml29-Nov-06 0:50
Bradml29-Nov-06 0:50 
GeneralRe: problem with frame levels Pin
Wim Engberts29-Nov-06 1:24
Wim Engberts29-Nov-06 1:24 
GeneralRe: problem with frame levels Pin
Wim Engberts28-Nov-06 23:30
Wim Engberts28-Nov-06 23:30 
Questionproblem with update database in php Pin
Arif Liminto28-Nov-06 21:30
professionalArif Liminto28-Nov-06 21:30 
AnswerRe: problem with update database in php Pin
Bradml28-Nov-06 22:42
Bradml28-Nov-06 22:42 
QuestionProblem with XMLHTTPRequest Pin
resmy.m@gmail.com28-Nov-06 20:06
resmy.m@gmail.com28-Nov-06 20:06 
AnswerRe: Problem with XMLHTTPRequest Pin
Bradml28-Nov-06 20:16
Bradml28-Nov-06 20:16 
GeneralRe: Problem with XMLHTTPRequest Pin
resmy.m@gmail.com28-Nov-06 20:24
resmy.m@gmail.com28-Nov-06 20:24 
I am developing an online webchat using xmlHttp Request.

I created the following script to get message from database

function getMessage()
{
clearInterval(interval);
frm = document.forms[0];
var xmlHttp=XHRFactory.getInstance();
sessionId=getCookie("chatSession");
from=getCookie("chatFrom");
//alert("hi");
url="chatprocess.aspx?msg="+from+ "&option=4&sessionID="+ sessionId;
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=function ()
{

if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
// alert("hihi");
if((window.ActiveXObject))
{
if(xmlHttp.responseBody != null )
{
isok=xmlHttp.responseText;
}
else
{
isok=xmlHttp.responseText;
}
}
else
{
if(xmlHttp.responseText.length != 0)
{
isok=xmlHttp.responseText;
}
else
{
isok="Not";
}

}
}
// isok=xmlHttp.responseText;

} ;
//alert(isok);
if(isok=="ok")
{
closeWindow();

}
else
{

getchatmessage();
}
xmlHttp.send();
return false;

}



In chatprocess.aspx i wrote the following code to fetch the content from database

private void GetMessage()
{


sql = "SELECT Chat_temp_From.Message FROM Chat_temp_From INNER JOIN Chat_Session ON Chat_temp_From.Session_ID = Chat_Session.Session_ID WHERE (Chat_Session.Session_Status = '1') and Chat_temp_From.Session_ID=" + sessionId+" and Chat_temp_From.Status=1";
msg = objDl.RetrieveMessage(sql);
sql = "update Chat_temp_From set Status=0 where Session_ID=" + sessionId;
bool deleteSuccessfully = objDl.ExecuteSQL(sql, ref rowsAffected);
if (!deleteSuccessfully)
{
Response.Write("Error");
}
Response.Write(msg);
}

But its not continusly calling the getmessage function in the javascript.


in the form load i am calling the following client script

function startChat()
{
interval=setInterval("getMessage()",10000);
}

but its not working
GeneralRe: Problem with XMLHTTPRequest Pin
Bradml28-Nov-06 21:21
Bradml28-Nov-06 21:21 
GeneralRe: Problem with XMLHTTPRequest Pin
resmy.m@gmail.com28-Nov-06 22:29
resmy.m@gmail.com28-Nov-06 22:29 
GeneralRe: Problem with XMLHTTPRequest Pin
Bradml28-Nov-06 22:47
Bradml28-Nov-06 22:47 
GeneralRe: Problem with XMLHTTPRequest Pin
resmy.m@gmail.com28-Nov-06 23:09
resmy.m@gmail.com28-Nov-06 23:09 
GeneralRe: Problem with XMLHTTPRequest Pin
Bradml29-Nov-06 0:41
Bradml29-Nov-06 0:41 
GeneralRe: Problem with XMLHTTPRequest Pin
ednrgc29-Nov-06 6:51
ednrgc29-Nov-06 6:51 
QuestionLogin System Implementation Pin
Bradml28-Nov-06 19:13
Bradml28-Nov-06 19:13 
QuestionFont problem in net Pin
kumar bharat bhusanam28-Nov-06 19:10
kumar bharat bhusanam28-Nov-06 19:10 
AnswerRe: Font problem in net Pin
Bradml28-Nov-06 19:14
Bradml28-Nov-06 19:14 
QuestionGoogle map API - adding overlays/tiles Pin
Grapes-R-Fun28-Nov-06 15:19
Grapes-R-Fun28-Nov-06 15:19 
QuestionTable-less layouts Pin
JimmyRopes28-Nov-06 13:42
professionalJimmyRopes28-Nov-06 13:42 
AnswerRe: Table-less layouts Pin
MatrixCoder28-Nov-06 14:06
MatrixCoder28-Nov-06 14:06 
GeneralRe: Table-less layouts Pin
JimmyRopes28-Nov-06 14:13
professionalJimmyRopes28-Nov-06 14:13 
AnswerRe: Table-less layouts Pin
George L. Jackson28-Nov-06 14:15
George L. Jackson28-Nov-06 14:15 
GeneralRe: Table-less layouts Pin
JimmyRopes28-Nov-06 14:26
professionalJimmyRopes28-Nov-06 14:26 
AnswerRe: Table-less layouts Pin
Guffa28-Nov-06 15:47
Guffa28-Nov-06 15:47 
JokeRe: Table-less layouts Pin
George L. Jackson28-Nov-06 16:10
George L. Jackson28-Nov-06 16:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.