Skip to content

IncludeJS

boxgaming edited this page Jul 17, 2026 · 1 revision

Includes a Javascript library for use by the current program.

Syntax

InludeJS url [, onLoadFn]

Parameters

  • The url parameter specifies the location of the javascript file to load. Javascript files can also be loaded from the virtual file system with this method.
  • The optional onLoadFn parameter is a reference to a SUB to call when the Javascript file has been loaded. If specified, the program will continue execution while the script is loaded in the background. If not specified, the program will wait for the script to finish loading before proceeding to the next statement.

Example

Import Sys From "lib/lang/system.bas"
Import Dom From "lib/web/dom.bas"

IncludeJS "https://cdn.jsdelivr.net/npm/@jstable/jstable@1.6.6/dist/jstable.min.js"

Dim link As Object
link = Dom.Create("link", document.head)
link.href = "https://cdn.jsdelivr.net/npm/@jstable/jstable@1.6.6/dist/jstable.min.css"
link.rel = "stylesheet"

Dom.Create "div", , _
    "<table id='person-table'>" + _
    " <thead>" + _
    "  <tr><th>Last Name</th><th>First Name</th><th>Favorite Color</th></tr>" + _
    " </thead>" + _
    " <tbody>" + _
    "  <tr><td>Doe</td><td>John</td><td>blue</td></tr>" + _
    "  <tr><td>Smith</td><td>Edward</td><td>red</td></tr>" + _
    "  <tr><td>Jones</td><td>Janet</td><td>green</td></tr>" + _
    "  <tr><td>Edwards</td><td>Fred</td><td>purple</td></tr>" + _
    " </tbody>" + _
    "</table>" 

Dim ptable As Object
ptable = Sys.Construct("JSTable", , "#person-table")

See Also

Import

Clone this wiki locally