EPUBCheck RSC-035: legacy JavaScript media type
Updated:
EPUBCheck RSC-035 is a usage message: “"…" is a legacy media type for JavaScript. Consider using 'text/javascript' instead.” A script uses a legacy media type for JavaScript, and EPUBCheck suggests text/javascript instead. It is a usage message, shown only with -u: the script still counts as JavaScript.
The official message
"%1$s" is a legacy media type for JavaScript. Consider using 'text/javascript' instead.
- Default severity
- Usage. Informative only and hidden by default: it appears when EPUBCheck runs with -u (--usage). It does not make the EPUB invalid.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- Manifest items or script elements written with an older value such as application/javascript.
- Templates and tools that predate text/javascript becoming the recommended value.
How to fix it
- Find the media type named in the message.
- Change it to
text/javascriptin the manifest item and in any script element type attribute. - Validate again with -u if you want a clean usage report.
When it's not this
A script with a non-JavaScript media type is the error RSC-034.
Terms used here
Other RSC messages
RSC-034Scripts must have a JavaScript media type.RSC-033Relative URL strings must not have a query component, but found one in "…".RSC-032Fallback must be provided for foreign resources, but found none for resource "…" of type "…".RSC-031Remote resource references should use HTTPS, but found "…".RSC-030File URLs are not allowed in EPUB, but found "…".RSC-029Data URL is not allowed in this context.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.