javascripthtml-framework-7

Framework7: how to get HTML of all pages?


I'm using Framework7 which is great. I need to parse innerHTML of all of my pages in runtime. How can I obtain HTML for page different than a current one? I was trying to make use of router, routes and page API's but with no luck.

To sum things up: I don't want to load different pages in the view, I want to load them in a variable to make some further processing. How to do it?


Solution

  • You can use in-build ajax:

    Framework7.request.get('somepage.html').then((res) => {  
      console.log(res.data);
    });
    

    You can also refer to the docs for further investigations