Code Page

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
Can I link my app.js file if both index.html and app.js are on the code page? Like this
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-COMPATIBLE" content="ie=edge">
<title>Document</title>
</head>
<body>

<script src="app.js"></script>
</body>

</html>
Photo of Michael Curtis

Michael Curtis

  • 596 Points 500 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,074 Points 20k badge 2x thumb
You can reference the app.js file saved as a code page in the application with DBID as follows:

<script src="DBID?a=dbpage&pagename=app.js"></script> 

Notes:

(1) for readability you should use relative URLs (as indicated above) instead of absolute URLs.

(2) for readability you should use &pagename instead of &pageID.

(3) If you copy the application you will need to manually modify the hard-coded DBIDs or your new application will be referencing the old code pages.
Photo of Michael Curtis

Michael Curtis

  • 596 Points 500 badge 2x thumb
Much appreciated dandiebolt!