问题
I have a link which makes a search. So far, it's working. The issue is when I want the search to be done through hiting the 'enter' button. So:
$('#searchedText').on('keypress', function(e) {
console.log("writed");
if ($(this).val().trim().length > 2) {
if (e.which == 13) {
console.log("Passed condition");
app.search = $('#searchedText').val();
// HERE'S WHERE I NEED TO TRIGGER RATCHET's PUSH
}
}
});
I tried to change window.location - Doesn't work I tried to trigger tap & click event - Doesn't work
Any ideas?
Thanks in advance.
回答1:
If anyone needs a solution for this, I finally found on the Ratchet's issues (github). If you wanna trigger a custom push, just do:
PUSH({url: 'YourUrl+hash', transition: 'slide-out'});
Regards
来源:https://stackoverflow.com/questions/30178538/how-do-i-trigger-ratchets-push-manually