Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
js responses高さの調整や、同じクラスの色付けなど、多くの点で同じコードがたくさんあることに気づきました。
js responses
その重複のすべてを関数に入れて、各js応答でその関数を呼び出す方法はありますか?もしそうなら、どのように?
coffeescript では、次を使用してグローバル関数を作成できます。
@adjustHeights = (arg1, arg2) -> ... code here
次に、js テンプレート内でこれを呼び出すだけです