开发者

rails javascript_include_tag

开发者 https://www.devze.com 2023-01-01 03:20 出处:网络
I have a few custom .js files in my public/javascripts folder. The \'javascript_include_tag\' adds script tags to the head element. Are these executed in the order 开发者_如何学Pythonin which they app

I have a few custom .js files in my public/javascripts folder. The 'javascript_include_tag' adds script tags to the head element. Are these executed in the order 开发者_如何学Pythonin which they appear. If yes, how do I control the order in which these script tags are added to my html.

thanks, ash


Yes, they are executed in order of appearance, so you just write them in the order you want. If you are currently using javascript_include_tag :all then you can include individual scripts instead to get the order you want:

javascript_include_tag :defaults
javascript_include_tag "script_1"
javascript_include_tag "script_2"
0

精彩评论

暂无评论...
验证码 换一张
取 消