点击拨打phonegap应用程序

时间:2014-10-07 18:09:29

标签: javascript android cordova

我有一个非常简单的phonegap应用程序,它由2个html页面组成。一个页面是目录列表,我希望能够单击以呼叫或单击条目上的短信。当我从网站提供页面时,点击呼叫/短信有效,但是当我在phonegap www fold中包含相同的页面并构建一个简单的应用程序时。

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width initial-scale=1.0" />
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <script src="js/jquery-1.11.1.min.js"></script>
  <script src="js/bootstrap.min.js"></script>
  <title>Mobile Group Directory</title>
</head>
<body style="background-color:#A5C1C9">
  <div class ="container-fluid">
    <div class="panel-group" id="directory">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title">
            <a data-toggle="collapse" data-parent="#directory" href="#A">    Anteater, Alfred</a>  cell:<a href="tel:1234567890">123-456-7890</a> <a href="sms:1234567890">Send SMS</a>
          </h3>
        </div>
        <div id="A1" class="panel-collapse collapse">
          <div class="panel-body">
            Alfred<br>123 Smart Way<br>Braintown, MO<br>anteater@yahoo.com
          </div>
        </div>
      </div>
      <br>
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title">
            <a data-toggle="collapse" data-parent="#directory" href="#B2">  Brown, Bob</a>  cell:<a href="tel:9876543210">9876543210</a> <a href="sms:9876543210">Send SMS</a>
          </h3>
        </div>
        <div id="B2" class="panel-collapse collapse">
          <div class="panel-body">
            Bob<br>345 Middle Way<br>Low Risk, MO<br>bob@msn.com
          </div>
        </div>
      </div>

    </div>
  </div>
</body>

1 个答案:

答案 0 :(得分:0)

请改为尝试:

document.location.href = 'tel:a number'