Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kit.javascripts << "path/to/file" won't load javascript #85

Open
profsmallpine opened this issue Jul 8, 2015 · 0 comments
Open

kit.javascripts << "path/to/file" won't load javascript #85

profsmallpine opened this issue Jul 8, 2015 · 0 comments

Comments

@profsmallpine
Copy link

html = render_to_string(:file => '/static/home', :layout => '/layouts/application')
@kit = IMGKit.new(html, :quality => 50, 'javascript-delay' => 10000)
@kit.stylesheets << "#{Rails.root}/app/assets/stylesheets/shops/#{@shop.subdomain}_preview.css"
@kit.javascripts << "#{Rails.root}/app/assets/javascripts/small_preview.js"

app/assets/javascripts/small_preview.js

someDiv = document.getElementById("desktop-header");
someDiv.innerHTML = "<h1>CATS</h1>";

I am trying to just get a sample working with adding a javascript file to my IMGKit jpg. This should just append CATS to my image, but it will not work. Is there anything special to know about adding javascripts? The stylesheets aren't having any problems. I hopped into the code where javascripts are being added in the IMGKit gem, and everything looked good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant