Server-Side Versus Client-Side


An imagemap can be written as a server-based, imagemapping script, or it can be coded into the HTML file itself to be run by the browser, or client . When the imagemap code is inserted directly into the HTML file, it's a client-side imagemap. When a script on the server is required, the code is a server-side imagemap.

graphics/bookpencil_icon.gif

To learn more about scripts, see Chapter 28, "Designing Fill-in-the-Blanks Forms."

Which should you create? Here's the full poop: Client-side imagemaps are much easier to create than server-side imagemaps. Client-side imagemaps work only when the page is viewed through an imagemap-compatible browser, but, fortunately, the overwhelming majority of folks online today use browsers that can handle client-side imagemaps. Client-side imagemaps are supported by

  • Every version of Internet Explorer since its debut

  • Netscape Navigator versions 2 and later

These browsers (which together represent about 90 percent of the browsers used on the Web) support not only client-side imagemaps, but also server-side imagemaps.

A very small proportion of folks online ”those using graphical browsers other than the ones I listed ”cannot use client-side imagemaps, but can use server-side imagemaps. Of course, those using text-only browsers cannot use any kind of picture links, including any sort of imagemap, whether client or server.

As you know from Chapter 28, writing scripts requires more technical expertise than most beginning Web authors care to develop. On top of that, publishing your scripts on a server requires close collaboration with the administrator of the Web server where your pages will be published to ensure that you write your script in a language the server supports and follow other rules that vary from server to server. Server-side imagemaps require much more work than client-side imagemaps and expand the reach of your page by only a tiny proportion.

Given that, I recommend doing what most Web authors do these days:

  • Stick to client-side imagemaps.

  • Make sure that a block of text links on the page repeats all links that are in any imagemap (or other picture link) on the same page (see Figure 29.2).

    Figure 29.2. Always repeat any links in an imagemap (or any other picture link) in text links on the same page, to serve those whose browsers don't support imagemaps or pictures.

    graphics/29fig02.jpg

Your client-side imagemaps will work great for nearly all visitors. And the text links will serve not only visitors whose browsers don't support client-side imagemaps, but also those with text-only browsers and those who have turned off the display of images in their browsers to speed up surfing.



Sams Teach Yourself Internet and Web Basics All in One
Sams Teach Yourself Internet and Web Basics All in One
ISBN: 0672325330
EAN: 2147483647
Year: 2003
Pages: 350
Authors: Ned Snell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net