Name
SRC — NN 3 IE 4 HTML 4
Synopsis
SRC=”URL"Optional
Imports a file of script statements from an external file. Once the external statements are loaded, the browser treats them as if they were embedded in the main HTML document. This attribute had some support in Internet Explorer 3, but it relied on a specific JScript.dll version, which makes it unreliable to blindly use it in IE 3.
In theory, you should be able to add script statements inside a
SCRIPT element that loads an external script
library file. In practice, it is more reliable to provide a separate
SCRIPT element for each external library file and
for in-document scripts.
Current implementations limit the SRC attribute to
point to JavaScript external files. Such files must have a
.js filename extension, and the server must have
the extension and application/x-javascript MIME
type set to serve up such files.
Example
<SCRIPT LANGUAGE="JavaScript" SRC="stringParseLib.js"></SCRIPT>
Value
Any valid URL. Current browsers require files whose names end in the .js extension. A complete URL may help overcome difficulties in some earlier browsers that implement this feature.
Default
None.
Object Model Reference
- IE
[window.]document.all.elementID.src
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access