How do I trigger Ratchet's push manually?

感情迁移 提交于 2020-01-16 21:56:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!