This is a migrated thread and some comments may be shown as answers.

View's show event never get fired

1 Answer 30 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ronald
Top achievements
Rank 1
Ronald asked on 24 Mar 2012, 10:58 PM

var productviewed = function(view) {
    alert("viewed");
};
$(document).ready(function() {
    $("#autoloan").bind("show", productviewed);
});

<div data-role="view" id="autoloan" data-title="Auto Loan" data-transition="slide" data-layout="message" >
...
</div>

I'm trying to hook to the show event of the view by doing the above. However the alert dialog seems to never get called.
Have I done something incorrectly? 

1 Answer, 1 is accepted

Sort by
0
Ronald
Top achievements
Rank 1
answered on 24 Mar 2012, 11:04 PM
this works

<div data-role="view" data-show="foo"> ...
 
<script>
function foo(e) {
 
}
</script>
Tags
General Discussions
Asked by
Ronald
Top achievements
Rank 1
Answers by
Ronald
Top achievements
Rank 1
Share this question
or