How to run javascript in sub loaded page? Facebook pixels

I wonder how I can run some javascript in a subpage that I load?
Is using componentUrl the only way I can do it?
Or can I somehow load a full html page with html, body and everything, so javascript works as well when it loads?

Im trying to get Facebook pixel code to load in a subpage and I need to have both the FB init script and to be able to set the og meta tags for adding my products to my Facebook catalog.
And the only way I can make it work as far as I know is to be able to run javascript in the subpage and not in my index page.

Has anybody worked with Facebook pixel in order to add products to their Facebook shop?
Any input really appreciated, thanks.

You want to run javascript inside a specific page?

Yes, you can add to the bottom of your webpage any javascript. Pretty simple.

For f7 v6:

<template>
    <html></html>
</template>
<script>
    export default (props, { $f7, $on, $update, $store }) => {
        return $render;
    }
</script>

Thanks, and I have to use componentUrl in my routes?

You have a few examples to go from on the initial build:

import HomePage     from '../pages/home.f7.html';

var routes = [
  {
    path: '/home/',
    component: HomePage,
  }
]

F7 V6 doesn’t use componentUrl , only component.

Don’t use older versions of F7 if you’re starting, V6 has a few things that come in handy .

1 Like

Ok thanks, thats what I tested before. Im using v5 thats why I have componentUrl.