Reputation: 3502
My main page is something like this
<ul data-role="listview" data-filter="true" data-filter-placeholder="search..." data-inset="true">
<li data-icon="info"><a href="MsaSiparis.aspx?Msa=1">
<img src="Img/s.jpg" width="64" height="64">
<h2>MASA 1 </h2>
</a></li>
<li data-icon="info"><a href="MsaSiparis.aspx?Msa=2">
<img src="Img/s.jpg" width="64" height="64">
<h2>MSA 2</h2>
</a></li>
<li data-icon="info"><a href="MsaSiparis.aspx?Msa=3">
<img src="Img/s.jpg" width="64" height="64">
<h2>MSA 3</h2>
and I am using some jQuery script the the page directed (MsaSiparis.aspx)
$(document).ready(function () {
$("#btnEkle").click(function (e) {
e.preventDefault();
var detay = $("#cmbDetay option:selected").text();
var miktar = $("#cmbMiktar option:selected").text();
var stringSatir = "<tr><th>"+count+"</th><td>"+detay+"</td><td>"+miktar+"</td><td></td></tr>";
$("#table-column-toggle").append(stringSatir);
++count;
$("#cmbMiktar option:selected").val(1);
$("#cmbDetay option:selected").val(1);
});
});
my button of this page like this,
<button id="btnEkle" name="btnEkle" class="ui-btn ui-icon-plus ui-btn-icon-left"> Add</button>
problem is the page is refresh and load again whenever I click to Add button even if I use preventdefault.how can I solve this problem
Upvotes: 0
Views: 559
Reputation: 861
Your code is working fine
$("#btnEkle").click(function (e) {
});
Please look at http://jsfiddle.net/v3f3z/6/
Upvotes: 1