最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to make an address clickable on a mobile device (like phone numbers are)? - Stack Overflow

programmeradmin2浏览0评论

How do I make an address clickable (detectable) by a mobile phone (similar to how phone numbers are)?

For addresses, it doesn't work directly. Is there perhaps an HTML tag for this?

How do I make an address clickable (detectable) by a mobile phone (similar to how phone numbers are)?

For addresses, it doesn't work directly. Is there perhaps an HTML tag for this?

Share Improve this question edited Jun 26, 2024 at 2:52 Melanie Shebel 2,9146 gold badges33 silver badges53 bronze badges asked Dec 15, 2011 at 14:22 xmuxxmux 7382 gold badges12 silver badges28 bronze badges 2
  • There is an <address> tag in HTML. Maybe that's what you should be using. Not sure if the phone browsers recognize it and makes it clickable, like it does with phone numbers. http://www.w3schools.com/html5/tag_address.asp – techfoobar Commented Dec 15, 2011 at 14:37
  • The webview that displays it must be configured to do so. – LuckyLuke Commented Dec 15, 2011 at 14:44
Add a comment  | 

3 Answers 3

Reset to default 14

Mobile devices look for 'http://maps.google.com/maps?' in the URL to launch the google maps app.

<a href='http://maps.google.com/maps?q=New+York+city&hl=en&sll=37.0625,-95.677068&sspn=58.598104,135.263672&vpsrc=1&hnear=New+York&t=m&z=11'>View in google maps</a>

You could use Google Maps URL as mentioned in another answer, but I would recommend keeping it agnostic and having the address open in the user's default map application.

You can do this with the geo: URI Scheme.

Here's an example:

<a href="geo:0,0?q=1600+Pennsylvania+Avenue+NW,+Washington,+DC">1600 Pennsylvania Avenue NW, Washington, DC</a>

Try using Microdata.

发布评论

评论列表(0)

  1. 暂无评论