Java Reference
In-Depth Information
exerCises
You can find suggested solutions to these questions in Appendix A.
1.
Create two pages, one called
legacy.html
and the other called
modern.html
. Each page
should have a heading telling you what page is loaded. For example:
<h2>Welcome to the Legacy page. You need to upgrade!</h2>
Using feature detection and the
location
object, send browsers that do not support
geolocation to
legacy.html
; send browsers that do support geolocation to
modern.html
.
2.
Modify Example 3 from the “Image Selection” Try It Out to display one of the four images
randomly. Hint: refer to Chapter 5 and the
Math.random()
method.