Hey,
You can use JS Modules to export/import code between pages.
JavaScript Modules (w3schools.com)You would have to put the URL address of your application, with the table ID and page ID appended in the import function and add type="module" to your script tags in your HTML.
Code page (HTML):
<script type="module" src="https://mycompany.quickbase.com/db/[TABLE_ID]?a=dbpage&pageID=[PAGE_ID]"></script>
Code Page (JS) 1 ():
export default let myFunction = () => {
// Some code here
}
Code Page (JS) 2:
import myFunction from "https://mycompany.quickbase.com/db/[TABLE_ID]?a=dbpage&pageID=[PAGE_ID]"
In theory this should work, however, I haven't tried it myself.
You could also try adding another script tag to your html pointing to the other JS file.
------------------------------
Luke Stone
------------------------------
Original Message:
Sent: 05-21-2020 22:15
From: Miguel Soto
Subject: Code Page execution
I have two Code page in that pages I do some quickbase API call and I create a functions inside, the doubt is if its possible to call a function in Page1 from page2 to avoid write the same code in both pages?
Any idea?
Thanks