Networks Worksheet 7 Client-Server and Peer-To-Peer
Networks Worksheet 7 Client-Server and Peer-To-Peer
Activity 1:
a) Open the file ‘Validation.html’ from the folder in a web browser
b) Enter your details in the two input boxes as shown on the web page
c) What happens?
nothing
d) Open the same file in a text editor, such as Notepad, or in a web page editor such as
Dreamweaver.
e) The function validate exists on the web page in the form of JavaScript:
1
Worksheet 7 Client and server processing
Unit 5 Networks and web technologies
g) Currently, the function validates just the ‘Name’ box and checks if the value is blank.
Save your web page. Open your web page in a web browser and test the new actions.
h) Why might it be useful from the clients point of view that the validation of this form takes
part before being submitted via the Internet?
2
Worksheet 7 Client and server processing
Unit 5 Networks and web technologies
Activity 2
a) Open up the file ‘Google Maps API.html’ using a web browser of your choice.
b) The web page should use the Google API script to display the general area of New York.
You can interact with this map using all of the usual Google features, such as zooming
in/out and changing the position of the map.
c) Open the web page in a text editor, such as Notepad, or in a web page editor such as
Dreamweaver.
d) Take a look at the HTML and JavaScript code. Can you figure out how this script works?
Reload your page in a web browser. What affect does this have on the web page?
The line of code you have just deleted is how the web page interacts with the Google
Map servers – this is the line that initialises the API
This is the function that defines the behaviour of the Google Map. It is completely defined by the
user and processed client-side
g) Edit this JavaScript function to change the behaviour of the Google Map.
You can change:
The position of the map (LatLng)
The amount of zoom
The map type (ROADMAP, TERRAIN, SATELLITE or HYBRID)
h) Add another Google Map to your web page. Center the map on London or your school.