Hello, I am currently making Android Applicatin using IONIC framework, I just created sample Application using below commands
- Ionic start HelloWorld
- cd helloworld
- ionic build android
- ionic emulate android.
I am able to run app successfully on emulator. Now, I added a hyperlink a tab-dash.html (this file will be created by default). Now, i added a js file called “tab-dash.js” and added below code. I referenced jquery-1.7.2.min.js also.
tab-dash.js
$(function() {
$('#reset').on('click', function() {
alert("Hello World");
});
});
this is how my tab-dash.html looks like:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script src="../js/tab-dash.js"></script>
</head>
<ion-view title="Dashboard">
<ion-content class="has-header padding">
<h1>Dash AIS</h1>
<div class="span4">
<div class="well">
<a id="reset" href="#" class="btn"><i class="icon-trash"></i> Hello World</a>
</div>
</div>
</ion-content>
</ion-view>
</html>
When I run this code in browser i am able to see alert box. But, when I tried in emulator I am not. Any idea what I am doing wrong here? I am new to Javascript and PhoneGap too.
Thanks.