Using client-side Javascript to access Application

Results 1 to 2 of 2

Thread: Using client-side Javascript to access Application

  1. #1
    Join Date
    Dec 1969

    Default Using client-side Javascript to access Application

    I&#039ve created a custom recordset application variable (in global.asa) which I&#039m using to maintain information which I need to pass between visitors on the site...I&#039ve been successful in transfering this information using VBScript on a standard ASP page, however, I&#039m trying to find a way to refresh the contents of the page with JavaScript so that I won&#039t have to refresh the entire page every few seconds...So, basically, I&#039m trying to take the following VB code:<BR><BR>&#060;%<BR>sub CheckMsgs()<BR>Application.Lock<BR>aMsg.MoveFirst< BR>Do While Not aMsg.EOF<BR>Response.Write aMsg("MsgFrom") & ": " & aMsg("MsgText")<BR>aMsg.Delete<BR>aMsg.MoveNext<BR >Loop<BR>Application.Unlock<BR>end sub<BR>%&#062;<BR><BR>and turn it into a client-side JavaScript routine which I can keep calling with a simple:<BR><BR>&#060;script language=javascript&#062;<BR>function CheckMsgs() {<BR><BR>&#060;...Insert Converted VB Code from Above...&#062;<BR><BR>timerid = setTimeout("CheckMsgs()",5000);<BR>}<BR>&#060;/script&#062;<BR><BR>So, is there a way to be able to handle this type of Application variable with Javascript or am I going to have to suffer with full page refreshes?<BR><BR>Thanks...<BR><BR>Mike

  2. #2
    Join Date
    Dec 1969

    Default RE: Using client-side Javascript to access Applica

    No - you have to refresh, because the client can only communicate with the server through an HTTP request (unless you want to get into Remote Scripting or Remote Data Service).<BR><BR>The other problem that you will have is that the Recordset object isn&#039t thread-safe for Application scope - it can only be accessed from the thread that created it, so every request will have to be served by the same thread. MAJOR scalabilty problem as soon as you&#039ve got more than one user.<BR><BR>Dunc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts