使用命令
添加了cordova设备插件cordova plugin add cordova-plugin-device
但仍然“device.uuid
”无效。
请参阅以下代码。
<script type="text/javascript" charset="utf-8" src="../cordova-7.0.1.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
//
function onDeviceReady() {
document.getElementById('deviceProperties').value = device.uuid ;
}
</script>
<body class="screen_background">
<div class="scrollable screen_background">
<div class="scrollable-content">
<div class="col-lg-12 col-sm-12 event_form_div">
<div class="col-lg-12 col-sm-12 left_right event_form">ARTCHITECS TRUST</div>
<div class="col-lg-12 col-sm-12 left_right sevent_form_subtitle">Enter details to see the latest event</div>
<div class="col-lg-12 col-sm-12 font_align input_box_div" ng-app="MobileAngularUiExamples" ng-controller="bookController">
<form method="post" name="latest_event" id="latest_event" ng-submit="insertData()">
<input class="input_box" type="text" name="name" placeholder="Name" ng-model="bname" required/>
<input class="input_box" type="text" name="email" placeholder="Email" ng-model="bemail" required/>
<input class="input_box" type="text" name="contact" placeholder="Contact" ng-model="bcontact" required/>
<input class="input_box" type="text" name="address" placeholder="Address" ng-model="baddress"/>
<input class="input_box" type="text" name="yearofpassing" placeholder="Year Of Passing" ng-model="byear"/>
<input class="input_box" type="hidden" name="duid" id="deviceProperties" ng-model="bduid">
<input type="submit" class="btn btn-default sub_btn" value="Submit">
</form>
<!-- <button type="submit" class="btn btn-default sub_btn" ng-click="insertData()">Submit</button>-->
</div>
<div class="col-lg-12 col-sm-12 left_right event_form_logo" ><img src="img/logo.jpg" alt="logoimg" class="logo"/></div>
</div>
</div>
</div>
</body>