HTML5 and CSS3, Second Edition
Setting the Default State We have a couple of issues to resolve. When we first bring up our page, our history state is going to ...
support. But because it does require rewriting the code, we’re not going to go through that process. I’ll leave that up to you. ...
Tip 31 Tip 31. Talking across Domains Client-side web applications have traditionally been restricted from talking directly to s ...
The support contacts will eventually come from a content-management system on another server, so for this prototype we’ll embed ...
<pclass="email">
[email protected]
</p> </li> <li> <h2>AccountsPayable</h2> <pclass=" ...
html5_cross_document/contactlist/javascripts/application.js $("#contactsli").click(function(event){ var email,origin; email= $(t ...
We style it up with this CSS that we add to stylesheets/style.css: html5_cross_document/supportpage/stylesheets/style.css #form{ ...
This places the form and the <iframe> side by side and adds basic styles to the form fields. Receiving the Messages The on ...
Tip 32 Tip 32. Chatting with Web Sockets Web developers have been pursuing real-time interaction with users for many years, but ...
We’ll use web sockets to implement the web interface for the chat server. Users can connect and send a message to the server. Ev ...
We’ll also need to add links to jQuery and a JavaScript file that will contain our code to communicate with our web-sockets serv ...
In our javascripts/chat.js file, we first need to connect to our web-sockets server, like this: html5_websockets/javascripts/cha ...
Now we just need to hook up the text area for the chat form so we can send our messages to the chat server. This handler also go ...
We can download a copy of the web-socket-js library^8 and place it within our project. We’ll use Modernizr again to detect for s ...
setupChat() method into the complete() callback. The complete() callback runs at the very end of the loading process, regardless ...
Figure 35—Cross-browser chatting Chapter 10. Creating Interactive Web Applications • 226 Download from Wow! eBook <www.wowebo ...
Tip 33 Tip 33. Finding Yourself: Geolocation Geolocation is a technique for discovering where people are, based on their compute ...
Figure 36—Our current location is marked on the map with a Y. We define the size of the image, and then we tell the Maps API tha ...
html5_geolocation/javascripts/geolocation.js Line 1 varshowLocation=function(lat,lng){ 2 varfragment="&markers=color:red|col ...
We use Google’s ClientLocation() method on line 3 to get a visitor’s location and invoke our showLocation() method to plot the l ...
«
7
8
9
10
11
12
13
14
15
16
»
Free download pdf