Joe Nine wrote:
> Scott Sauyet wrote:
>> I don't think a 404 would be an issue. The issue is when the page
>> referenced is not proper JS. If you use a blank "src" attribute, then
>> it's requesting the current HTML file for the JS. That will certainly
>> cause problems. If you requested "myDoc.html", it would probably also
>> cause problems (assuming that file included HTML.)
>
> Thanks Scott (and Thomas in his reply). I hadn't realized (and find it
> quite strange) that creating a tag with a blank src attribute would
> request the current HTML file for the JS. How unusual, [...]
Only to the uninitiated, I am afraid. The value of the `src' attribute of
SCRIPT elements is specified to be of type URI⁽¹⁾, that is, a URI or URI-
reference as specified in RFC 3986⁽²⁾ (which obsoletes RFC 2396, which
updates RFC 1738, which is therefore referred in the HTML 4.01
Specification⁽³⁾).
An empty URI-reference is specified to be a same-document URI-reference.⁽⁴⁾
You can find that, for example, with the `action' attribute of FORM
elements, too, primarily if the document is dynamically generated by a
server-side application (like PHP).⁽⁵⁾
You're welcome
Regards,
PointedEars
___________
⁽¹⁾ <http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.2.1>
⁽²⁾ <http://tools.ietf.org/html/rfc3986>
⁽³⁾ <http://www.w3.org/TR/REC-html40/types.html#type-uri>
⁽⁴⁾ <http://tools.ietf.org/html/rfc3986#section-4.4>
⁽⁵⁾ <http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.3>
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann