Weird redirect using data-bind submit, sammy.js and knockout.js together

蓝咒 提交于 2019-12-02 20:38:37

After much searching, and not finding any answers here on SO, I ended up finding this:

https://groups.google.com/forum/?fromgroups#!topic/sammyjs/EYW-2Ygk3z8

And modified my code to this:

Sammy(function() {

    // Override this function so that Sammy doesn't mess with forms
    this._checkFormSubmission = function(form) {
        return (false);
    };

}).run();

So that Sammy never attempts to do anything special when a form is submitted on my page. Since I'm using Knockout, I don't plan on using Sammy for any forms. If you want more complex code or a plugin version you can see the above URL, but for me, and I suspect for most using KO, it's less code and easier to just disable this Sammy feature.

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