移动端巧用href属性

移动端页面常常需要在网页中实现拨打电话,发送短信,发送邮件等功能。如何去实现呢?
非常简单仅仅需要a标签的一些属性即可完成

1打电话

在电话号码前面可以加上 + (加号)表示国际号码。如:

<a href="tel:10086">10086</a>

发短信

 <a href="sms:10086">给 10086 发短信</a><br />
 
 <a href="sms:10086?body=cxye">给 10086 发送内容为"cxye"的短信</a><br />
 
 <a href="sms:10086,10010?body=cxye">给 10086 和 10010 发送内容为"cxye"的短信</a>

发送邮件

<a href="mailto:[email protected]">mail</a>

<a href="mailto:[email protected],[email protected]">mail</a>

<a href="mailto:[email protected]?subject=Testing">mail</a>

<a href="mailto:[email protected]?subject=Testing mailto&[email protected]">mail</a>

激活安卓市场

 <a href="market://search?q=[query]">Android Market link</a>//query是搜索内容
 <a href="market://search?q=MyApp">MyApp</a>

GPS

 <a href="geopoint:[经度],[纬度]">我的位置</a>
<a href="geopoint:108.954823,34.275891">我的位置</a>

猜你喜欢

转载自www.cnblogs.com/jlfw/p/12915686.html