简体   繁体   中英

pass variables through imagemap

I have a country map with many cities. i have spotted every city with an imagemap. I would like to display database data relevant to each city when the spot get clicked. Is there any possible way to pass variables(id?) through the imagemap in order to display data using this variable?

Thanks a lot!

You can use the query part of the URL in the href attribute of an area element (I presume that you are using a so-called client-side image map, using a map element containing area elements). Example:

<area shape="circle" coords="100,200,5" alt="London" href=
  "/foo.php?thing=42&amp;stuff=something&amp;country=GB">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM