jQuery in CodeIgniter, inside the view or in external js file?

前端 未结 3 1310
野的像风
野的像风 2020-12-29 13:13

I\'m developing web application using CodeIgniter. All this time, I put the custom js code to do fancy stuffs inside the view file. By doing this, I can use site_url()

3条回答
  •  执笔经年
    2020-12-29 13:39

    Donny, if you start passing through every URL separately you will just be giving yourself a ball-ache. Why not just pass through base_url() and contcat the controller/method on the end?

    You lose the ability to swap around index_page and url_suffix settings but they shouldnt really change all that often anyway.

提交回复
热议问题