Google Map is refreshed
I have google map API which is wroking fine in Chrome, Mozilla, Netscape and safari but there is a problem in IE, once I enter the text in text area and clicked search link it is not showing me the address rather just getting refres开发者_C百科hed. Please could any one provide me a solution for this.
Thanks and Regards, Syed Zubair.
Are you doing something like the following?
<a href="#" onclick="doSearch();">Search!</a>
Your problem that IE is following the link when you click on it, thus causing the page to reload. Traditionally, people have often worked around this by doing the following:
<a href="javascript:void()" onclick="doSearch(); return false;">Search!</a>
But I've had mixed results with that in IE. Instead, try using a <span>
instead of an tag and then style it to look like a link (that is, use text-decoration:underline and color:blue in CSS). If switching from an anchor tag to a span fixes it, then you know that's the problem.
My personal preference is to reserve <a>
tags only for actual links to other pages or real anchors in the page.
精彩评论