Last active
October 25, 2016 05:36
-
-
Save azusanakano/55f4402e5b42866ec69c to your computer and use it in GitHub Desktop.
Ruby on Railsでリンクで移動した時javascriptが実行されない問題 ref: http://qiita.com/azusanakano/items/1b96a2be0f967365a873
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready( xx.. ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on 'page:before-change' , -> console.log 'page:before-change' | |
$(document).on 'page:fetch' , -> console.log 'page:fetch' | |
$(document).on 'page:receive' , -> console.log 'page:receive' | |
$(document).on 'page:change' , -> console.log 'page:change' | |
$(document).on 'page:update' , -> console.log 'page:update' | |
$(document).on 'page:load' , -> console.log 'page:load' | |
$(document).on 'ready page:load' , -> console.log 'ready and load' | |
$(document).ready -> console.log '$(document).ready in assets' | |
$(window).on 'load' , -> console.log '$(window).load in assets' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on 'page:before-change' , -> console.log 'page:before-change' | |
$(document).on 'page:fetch' , -> console.log 'page:fetch' | |
$(document).on 'page:receive' , -> console.log 'page:receive' | |
$(document).on 'page:change' , -> console.log 'page:change' | |
$(document).on 'page:update' , -> console.log 'page:update' | |
$(document).on 'page:load' , -> console.log 'page:load' | |
$(document).on 'ready page:load' , -> console.log 'ready and load' | |
$(document).ready -> console.log '$(document).ready in assets' | |
$(window).on 'load' , -> console.log '$(window).load in assets' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ページ切り替え時(初回ページも対象) | |
$(document).on 'turbolinks:load', -> console.log 'turbolinks:load' | |
# ページ切り替え時(初回ページは対象外) | |
$(document).on 'turbolinks:render', -> console.log 'turbolinks:render' | |
# ページ遷移前 | |
$(document).on 'turbolinks:request-start', -> console.log 'turbolinks:request-start' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ページ切り替え時(初回ページも対象) | |
$(document).on 'turbolinks:load', -> console.log 'turbolinks:load' | |
# ページ切り替え時(初回ページは対象外) | |
$(document).on 'turbolinks:render', -> console.log 'turbolinks:render' | |
# ページ遷移前 | |
$(document).on 'turbolinks:request-start', -> console.log 'turbolinks:request-start' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'jquery-turbolinks' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment