HTML and CSS Reference
In-Depth Information
Obviously this is not a workable solution for a production application.
As Electrotank (and other companies who make similar products) con-
tinue to improve the functionality of their APIs and add support for
HTML5 WebSockets, this limitation should disappear.
The best way to test a multiplayer application on your own development machine is to
open two web browsers, or two web browser windows, at the same time. When you
look at CH11EX2.html in Google Chrome using this method, you should see something
that looks like Figure 11-5 .
Figure 11-5. ElectroServer chat demo on the canvas with JavaScript API
The full source code is listed in Example 11-2 .
Example 11-2. ES5 chat demo
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
<title>CH11EX2: ES5 Chat Demo</title>
<script src="modernizr-1.6.min.js"></script>
<script src="ElectroServer-5-Client-JavaScript.js"></script>
<script type="text/javascript">
window.addEventListener("load", eventWindowLoaded, false);
function eventWindowLoaded () {
Search WWH ::

Custom Search