• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Web Sockets for applications other than chat

Explorer ,
May 28, 2015 May 28, 2015

Copy link to clipboard

Copied

I run a small call center where a small group of employees log into an authenticated ColdFusion web site.  The purpose of the web site is to poll an Access database every 30 seconds, and any consumer asking for information (having submitted a lead from a web form that posts the customer info to the database) is then promptly contacted.  At this point the process is conducted using an index page that refreshes (every 30 seconds via a meta refresh).  But I am wondering if this is a scenario that would be better served through the use of web sockets?

I must say that web sockets is a new technology to myself.  And upon my attempts to learn more via examples on the web, I find that the typical example consists of a web chat interface.  That too is intriguing to myself, but I am most concerned with at this time with a means to better implement efficiencies to the index page.  I estimate that 4,000 queries are made every day against the Access database.  It works, but there must be a better way?      

Views

284

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , May 29, 2015 May 29, 2015

Using jquery you can use the load() method which will load a page to an element.

Simply have your page with an empty div that will have the content you are looking to refresh. Create a function with a load method in to get the data you want. When you first visit the page, the call is done for the first time, populating the data. A setInterval is setup which calls the function again every x seconds updating the div.

So you could have a simple page like so:

<html>

<head>

    <script>

          func

...

Votes

Translate

Translate
Advocate ,
May 29, 2015 May 29, 2015

Copy link to clipboard

Copied

LATEST

Using jquery you can use the load() method which will load a page to an element.

Simply have your page with an empty div that will have the content you are looking to refresh. Create a function with a load method in to get the data you want. When you first visit the page, the call is done for the first time, populating the data. A setInterval is setup which calls the function again every x seconds updating the div.

So you could have a simple page like so:

<html>

<head>

    <script>

          function loadContent(){

              $("#content").load('pageThatContainsTheInfo.cfm');

          }

          $(document).ready(function(){

                loadContent();


                setInterval(function(){

                    loadContent();

                },30000);

          });

    </script>

</head>

<body>

    <div id="content"></div>

</body>

</html>

Much easier and quicker solution then trying to get something like websockets to work to do this. Websockets will require something to "talk" to in that something in the back end will need to send messages to the front. This example above can just quickly be done on the already existing content.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation