четверг, 23 мая 2013 г.

property insurance association of louisiana

JavaScript - Objects as associative arrays

property insurance association of louisiana


Objects as associative arrays


See section 5K of the book .


On this page I explain how JavaScript objects are also associative arrays (hashes). Using these you can associate a key string with a value string, which can be very useful sometimes.


Suppose you have a mouseover / click image swap script. You want to keep track of the status of each image, whether it is normal, mouseovered or clicked. In addition you want to be able to reach this status by image name. So if you have an image named 'Home ' you want to read out


and get one of the values 'normal ', 'mouseover ' or 'clicked ', corresponding to the current status of the image.


To do this you need JavaScript objects .


Objects in JavaScript


JavaScript is an object oriented language. However, in practice objects define... http://auto-car.ucoz.com/news/property_insurance_association_of_louisiana/2013-05-23-3386


Комментариев нет:

Отправить комментарий