mah*_*esh 3 html5 extjs sencha-touch sencha-touch-2
我有一个样本sencha触摸应用程序试图实现电子邮件,呼叫和短信功能,但在运行应用程序时,它不会打开电子邮件窗口或呼叫窗口.我能否知道使其正常工作的正确语法?
示例代码:
Ext.define('Sample.view.ContactsView', {
extend:'Ext.Panel',
requires:[
'Ext.form.FieldSet',
'Ext.field.Text'
],
alias:"widget.contactpage",
initialize:function () {
this.callParent(arguments);
},
config:{
items:[
{
xtype:'titlebar',
title:'Contact Us'
},
{
xtype:'panel',
layout:'hbox',
items:[
{
xtype:'button',
flex:1,
id:'smsButton',
handler:function(){
document.location.href = 'sms:464646'
}
},
{
xtype:'spacer'
},
{
xtype:'button',
text: 'Phone',
id:'callMeButton',
flex:1,
handler:function(){
document.location.href = 'tel:+1-800-555-1234'
}
}
]
},
{
xtype:'button',
text:'Email',
id: 'emailButton',
handler:function(){
document.location.href = 'mailto:webmaster@example.com'
}
}
]
},
});
Run Code Online (Sandbox Code Playgroud)
使用window.open()方法.
window.open('tel:+1-800-555-1234');
window.open('mailto:webmaster@example.com');
Run Code Online (Sandbox Code Playgroud)