Coder Social home page Coder Social logo

Comments (7)

Pezmc avatar Pezmc commented on June 22, 2024

By the looks of it the code assumes the <head> (apart from the title) is the same and doesn't check for changes in CSS or scripts.

It just takes anything within the <body> of the new page and swaps it with the<body> of the current page.

Perhaps it could assess if there are changes in style sheets and if necessary preload & swap them in.

from instantclick.

dieulot avatar dieulot commented on June 22, 2024

InstantClick only changes the <body>.

I realize now that the website doesn’t talk about that (it only says it’s the same mechanism as pjax), I’ll change that soon. Sorry!

from instantclick.

pedrokost avatar pedrokost commented on June 22, 2024

I see. Turbolinks has a data-turbolinks-track attribute that can be added to scripts in the head, which causes them to be reloaded. It would be a welcome addition to InstantClick.

from instantclick.

dieulot avatar dieulot commented on June 22, 2024

Yup, tracking asset changes should come.

On Sunday, February 9, 2014, Pedro Kostelec [email protected]
wrote:

I see. Turbolinks has a data-turbolinks-trackhttps://github.com/rails/turbolinks/pull/133attribute that can be added to scripts in the
head, which causes them to be reloaded. It would be a welcome addition to
InstantClick.

Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-34573220
.

from instantclick.

IonicaBizau avatar IonicaBizau commented on June 22, 2024

@dieulot Wouldn't be useful an option to change the head too? I have the same problem.

from instantclick.

dieulot avatar dieulot commented on June 22, 2024

Nope, it would load the stylesheets after the body is displayed, giving an unpleasant flash of wrongly-styled content in the beginning.

I don’t have a good solution to suggest to sites using different stylesheets on different pages, and I’m not sure we’ll ever find a silver bullet. Only a rearchitecture of one’s stylesheets will do.

from instantclick.

IonicaBizau avatar IonicaBizau commented on June 22, 2024

Yeah, so definitely I have to load same CSS on all pages. Thanks for feedback.

from instantclick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.