GithubHelp home page GithubHelp logo

Comments (3)

jaunesarmiento avatar jaunesarmiento commented on May 3, 2024

Hi @florindumitru, yes Fries does not execute any scripts from the loaded page. You must add your scripts to index.html and listen for events there.

from fries.

florindumitru avatar florindumitru commented on May 3, 2024

@jaunesarmiento pls also need to know if fries work on iOS and android 2.2 ?

from fries.

jaunesarmiento avatar jaunesarmiento commented on May 3, 2024

Here's a little something on how to do this, you must catch the push event that stack.js fires whenever a page gets pushed onto the screen.

So given that you have an inner page like this:

<div id="page2" class="page">
  <!-- some content here -->
</div>

You just need to do the following in your index.html:

<script type="text/javascript">
window.addEventListener('push', function () {
  if (document.getElementById('page2')) {
    console.log('We are on page 2');
    // do what you want here
  }
});
</script>

This may not be the best solution but I think this will work for now. @aymanfarhat and I have already had a few discussions on how to hook code when loading a new page. I think this is something that should really be included in Fries.

And no, I actually haven't tested Fries on iOS. And I believe it won't work on Android 2.2 due to its stock browser being outdated.

from fries.

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.