Updating a web page

Posted by / 17-Dec-2018 10:21

Updating a web page

var microsoft = microsoft

Create your HTML5 page as follows: You can put any content you like in your element, as long as it has an ID attribute so that you can identify it in your script.

The placeholder text should only appear when the page first loads, but will disappear when the script runs.

Because we want the function to continue receiving and handling updates, we add the script section in the body of the page.

Of course your own pages may execute functions on user interaction, but for the purposes of this demonstration add the following script at the end of your page, before the closing body tag: The script first checks that the browser supports the Event Source model.

If it doesn’t, an error message is written to the server data page element instead.

updating a web page-63updating a web page-4updating a web page-53

If the browser does support the function, the Server-Sent process begins.