WebDev Tutorial – Call Server at Regular Intervals

WebDev No Comments »

If you need to call a server process at regular intervals in your web page then this is actually a simple task that requires only a few lines of code and a little Ajax fun.

In this tutorial I will show you how to create a page to display the current system time. It will show you the principles of how to perform this operation so you can then use it in your own web apps.

I firstly created a Dynamic WebDev App and added a page. On the page I added a Cell component and inside a Static Control which will display the time.

image

We are not going to be using any JavaScript for this, just some simple WL. Firstly we need to add a Timer to the browser load event.

image

Now remember this code is executed in the browser and not on the server so make sure you choose the correct event.

The code will call a WL method called CheckTheTime every second. You need to create a New Local Browser Procedure which the timer will call.

image

This is one of many things I love about WebDev, making AJAX calls is such  a breeze. So the code above will call a method on the server which will return the current system time as a string.

So now create a new Local Procedure (server side procedure) called GetTime. As you are making an AJAX call to this method you have to enable it to allow this type of action. Once again this is very simple, just click on the AJAX word at the top next to the method and the LED light will go green to show it has been enabled.

image

Then all you have to do is write the code which returns time time.

image

That’s it, you are done. Running the page will now display the current time and will automatically refresh every second.

Are PC Soft Really Committed to the WinDev English Version?

WebDev, WinDev 36 Comments »

WinDEV 14 – Top 10 Features I am Excited About

WebDev, WinDev No Comments »

WebDEV – Using Guidelines to Protect Your Page Boundaries

WebDev No Comments »

WebDEV Search Engine Optimization

WebDev No Comments »

WebDEV – Old Style HTML Code

WebDev No Comments »

Creating Landing Pages with WebDEV

WebDev No Comments »

Building Squeeze Pages with WebDEV

WebDev, WinDev No Comments »

WebDEV – Expand Cell to Fill Page

WebDev No Comments »

Using JQuery with WEBDEV 12

JQuery, WebDev, WinDev 1 Comment »
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in