无连接协议 有链接协议
We've always been able to create links with protocols other than the usual HTTP, like mailto, skype, irc ,and more; they're an excellent convenience to visitors. With mobile phone browsers having become infinitely more usable, we can now extend that convenience to phone numbers:
我们始终能够使用非常规HTTP的协议创建链接,例如mailto ,skype,irc等。 它们为游客提供了极大的便利。 随着手机浏览器变得越来越可用,我们现在可以将便利性扩展到电话号码:
The tel
protocol is used for phone numbers:
tel
协议用于电话号码:
<a href="tel:18008675309">Call Jenny!</a>
If you'd like to create a link for SMS text messaging, that's easy enough too:
如果您想为SMS文本消息创建链接,这也很容易:
<a href="sms:18008675309">Text Jenny!</a>
The sms
protocol is used for text.
sms
协议用于文本。
Many mobile browsers automatically linkify phone numbers on webpages but with the snippet above you can forcibly create phone links! Since said links don't work on desktop browsers, it's probably wise to create a JS snippet to replace spans with a given CSS class with phone links.
许多移动浏览器会自动链接网页上的电话号码,但是通过上面的摘录,您可以强制创建电话链接! 由于上述链接在桌面浏览器上不起作用,因此创建JS代码段以使用电话链接将CSS范围替换为给定CSS类可能是明智的。
无连接协议 有链接协议