后台要用开关插件,就看到了这个,感觉还不错
if ($(this).hasClass('switch-on')) {
if (typeof on == 'function') {
on($(this));
}
} else {
if (typeof off == 'function') {
off($(this));
}
}我感觉把$(this) 传过去更容易进行下一步操作
作者, 我有个问题 . 请问 插件发送ajax的位置 应该放在代码的哪里?