What is the difference between a legend and a key? Is a legend still a legend if it is at the top of a page? Where is the optimal placement of a legend or key for a page that scrolls?
A legend describes a particular object on a page, e.g. if it's a map, a legend will describe a particular area as "Averill Park".
A key applies to the entire map, e.g. a "1:100" scale.
For a page that scrolls, I think that much depends on how many legends you have:
If it's only a few and they are not all bunched up in one area, and the legends are brief, you can use static legends, i.e. something that's permanently there and scrolls along with the page.
Got a lot? then displaying the legend using small popup windows on hover (or touch) might be a better idea -- provided that you use a clear icon on the main page to indicate the presence of additional information. This has the additional benefit of giving you more room for the legend.
As for keys, I suggest either the top or bottom, or both; but not the left or right.
They're the same thing.
The legend or key describes types of symbols/lines and can also describe specific locations. Types of roads, the symbol for locations such as camping grounds, hospitals, cities vs towns and what not.
There is no standard placement as it usually relies on fitting into the content in the map. If your map has featureless land or ocean, that's usually a good place to put it.