Difference between revisions of "Webeshoppin"
From Wiki2
(→click) |
|||
| Line 26: | Line 26: | ||
===click=== | ===click=== | ||
<pre> <script> | |||
//Why is delete button not firing? | //Why is delete button not firing? | ||
$('#thelists').bind('pageinit', function(event) { | $('#thelists').bind('pageinit', function(event) { | ||
| Line 46: | Line 46: | ||
</script> | </script> | ||
</pre> | |||
Revision as of 14:09, 30 January 2012
to force a move with refresh method1
location.href= 'food2buy.html?repo=' + rep + '&list=' + lis;
method2
$('#allyourlists').append('<li><a href="food2buy.html?repo=' + rep +
'&list=' + lis + '" data-ajax="false" >Repo: ' + rep + '& List: ' +
lis + '</a></li>');
Why doesn't the clich http://10.0.1.18/webeshoppin/stuff2get/zmisc/buttonnotfiring.html
javascript
var myCars=new Array(); // regular array (add an optional integer
myCars[0]="Saab"; // argument to control array's size)
myCars[1]="Volvo";
myCars[2]="BMW";
2:
var myCars=new Array("Saab","Volvo","BMW"); // condensed array
3:
var myCars=["Saab","Volvo","BMW"]; // literal array
click
<script>
//Why is delete button not firing?
$('#thelists').bind('pageinit', function(event) {
console.log('in bind pageinit for yourlists');
var thelists = ["list1", "list2"];
console.log(thelists);
$.each(thelists, function(index, alist) {
$('#allyourlists').append('<li><a href="index.html" data-role="button" id="delalist">List: ' + alist + '</a></li>');
});
$('#allyourlists').listview('refresh');
});
//gets the val of val1 from the previois call
$('body').on('click', "#delalist", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
alert ('in delalist') ;
});
</script>