Using Chained Jquery plugin

為{幸葍}努か 提交于 2019-12-02 06:04:19

This has nothing to do with CakePHP really - it's a client-side javascript library.

But you have two problems, first:

(function() { 
    $("#series").chainedTo("#mark");
});

Is not actually "running", you just defined an anonymous function that would run, if called. It should just be moved, probably, to where you're alert resides:

<script type="text/javascript">
    $(document).ready(function () {
        $("#series").chainedTo("#mark");
    });
</script>

Now it'll run, but if you checked the browser Console, it'll be erroring out, something like:

Uncaught TypeError: $(...).chainedTo is not a function

It looks like the library isn't running correctly.

I'm not sure where you got the source code for the jquery chained library, but it's not the current version in the page you link's github grab it from:

https://github.com/tuupola/jquery_chained/

A direct minimized version is listed here:

https://raw.githubusercontent.com/tuupola/jquery_chained/master/jquery.chained.min.js

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