javascript - Unwanted href attribute redirect in IE8 -
i'm using area tags on 1 of pages along jquery.maphighlight in order able select parts of picture, light them or light them off when user clicks on them. have lot of areas i'm using on, 20 , i'm using href attribute figure out 1 clicked , whether should highlight on or off. area looks this:
<area data-maphilight='{"fillcolor":"00cc00","shadow":false, "strokecolor":"000000", "alwayson":false}' shape="poly" href="20" coords="554,266,548,268,485,268,475,266,471,266,471,283,484,295,548,295,551,293,555,295,561,296,568,296,573,293,576,288,577,282,576,275,573,270,569,267,563,265" />
the javascript looks @ href attribute value , figures out do. works fine except in ie8. issue since href attribute there, ie8 considers link , redirects me again same page adding href value after while other browsers run js functions , nothing else. question how can stop ie8 redirecting me page , stay on current 1 can see javascript working fine in second before page disappears , i'm redirected next one?
just don't use href
attribute. use data-reference="20"
or something.
Comments
Post a Comment