philwei — 2011-07-11T15:16:24-04:00 — #1
I am currently encountering a problem with setting "display" property from "none" to "block":
browsers will refresh itself when the display property is changed; this causes the element to display then suddenly disappear after the page reload. Do you guys have an idea what I can do to avoid it?
philwei — 2011-07-11T15:17:14-04:00 — #2
BTW, in IE9, the page reload even results in redirecting to the index page.
philwei — 2011-07-11T15:25:20-04:00 — #3
NVM guys, i figured it out.
Do not add href attribute to the element where you want to change the display property, cuz it will cause the browser to reload.
paul_wilkins — 2011-07-11T19:13:25-04:00 — #4
That occurs because the web browser is performing the default behaviour for that element.
Normally you can prevent that default behaviour by returning false from the function that handles the onclick event.