How to load external JavaScript files with Turbolink?

Viewed 753

I have two main external JavaScript files that are a necessary for the site's interface. Now the thing is, because Turbolink simulates the website as a one page web app, those files are not being loaded when I do an ajax call or any.

I tried these options and all failed:

<script type='text/javascript' src='//some_domain.com' data-no-turbolink>

<script type='text/javascript' src='//some_domain.com' data-turbolinks-track="true"></script>

$(document).on("page:load", function(){
  $("head").append("THE_SCRIPT_TAG");
});

I also tried this:

<%= javascript_include_tag "some_domain.com' => true %>

Is there a way to load all script tags like any other website but still act like a one page web app with turbolinks?

0 Answers
Related