Load specific script when routing

Came across a problem where I need to load an html page with an inline script that must have set certain attributes when it loads to function properly, because if I programmatically change the data attribute value of the script tag, once loaded, the script does not take changes., so putting it in a modal in the index page is not a solution.

So putting it clean I need a way of loading a page that has a script inside, in a view, and before loading, pass additional data to that page (the data would become the data attribute on the script tag before loading) so when the page is loaded the script properly takes the data passed.

<div class="page">
<div class="navbar">
    <div class="navbar-inner sliding">
    <div class="left">
        <a href="#" class="link back">
        <i class="icon icon-back"></i>
        <span class="ios-only">Back</span>
    <div class="title">About Framework7</div>
<div class="page-content">
    <form action="https://www.mi-sitio.com/procesar-pago" method="POST">

In this case “data-transaction-amount” is the value that I need to change before loading.
Is there a way of routing and loading scripts in the target page?

Inline scripts won’t work. Use page events to execute what you need on page load, or better Router Components https://framework7.io/docs/router-component.html

Almost everything starts to work fantastic when I use router components, seems it is time to learn a bit of Vue.

Thank you Vlad.