Joel Byrd wrote:
In PHP, there is a require_once() function which includes a file only
if it is not already included. Is there an equivalent function in
Javascript (one that checks if a .js file has been included)?
No.
If not a straight-up function, is there some other way to check if a
javascript file has been included already?
Yes, you could define a special variable or property and check for
that, or you could check the DOM tree for a `script' element with
a special `src' property value.
But then there is no need for a test as loading client-side scripts
dynamically is unreliable and the document author should have control
about its contents.
PointedEars