dongyi4420 2010-05-30 16:29
浏览 52
已采纳

Jquery函数。 我应该把它放在一个文件中还是可以散布它?

So, I have a lot of php files where I use jquery functions. Do I need to create a seperate .js file for all jquery functions or I can put it together with php files or it actually doesn't matter at all?

  • 写回答

3条回答 默认 最新

  • duanpu5048 2010-05-30 16:36
    关注

    If you need a custom function on a page, I would leave that in the page. Anything your going to reuse between pages, should be in a global library function that you can include on all pages. Try to reuse as much as your code as you can in a library function.

    Try to extract as much as your code into library functions. It's easier to maintain, and reduces code duplication.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择