阅读背景:

当我将代码移动到与$(document).ready(function()){}分开的文件时,addClass不起作用

来源:互联网 

I have a code snippet that I will be using across numerous pages. This code is used for updating the column headers in a table to show if a column is sorted ascending or descending. I would like to place in a separate .js file rather than duplicating it across all pages. The snippet works correctly when it is within the $("body").on("click") function. When I move it to its own function and call that function, the script executes, however the results of the addClass/removeClass don't persist to the web page. Any assistance would be appreciated. I am quite new to JQuery and haven't found any direct help for this.I have a code snippet that I will be using acro




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: