Closed Bug 107058 Opened 23 years ago Closed 19 years ago

<link rel="script" href="script.js" type="text/javascript" /> not working

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

VERIFIED INVALID

People

(Reporter: jesse.houwing, Unassigned)

Details

(Whiteboard: WONTFIX per comment 12?)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.5+)
Gecko/20011026
BuildID:    2001102603

<link rel="script" href="script.js" type="text/javascript" />

should do the same as:

<script src="script.js" type="text/javascript"></script>

But script requires an end-tag and for XHTML, and because empty containers
should be avoided, I'd prefer the <link /> tag for this.

Reproducible: Always
Tenatively moving to DOM HTML. (should be jst's bug). This is suggested in the
HTML 4.01 DTD comments, BTW, so this isn't completely unprecedented.
Assignee: rogerl → jst
Status: UNCONFIRMED → NEW
Component: Javascript Engine → DOM HTML
Ever confirmed: true
QA Contact: pschwartau → stummala
could not find "script" in the recognised link types, jst can you please look in 
to this bug.
Does this break large existing sites? If so we should fix it soon, if not, it
won't get any attention in the near future.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.1
Homesite 5.0 supports it, that's how I even found out it was possible. Currently
there are no major sites that support it, as it's unsupported by major browsers.
But It is a much better was to attach srcipts than an empty script tag.
Especially in XHTML, in the reccomendations it states that empty containers
should be avoided at all times where possible and because this is a possible way
to do it within the standards reccomendation this should be implemented I think.

But I agree, it isn't a high prio bug.
Priority: -- → P5
Is there any chance this might work in the near future?
Target Milestone: mozilla1.1alpha → ---
Mass-reassigning bugs.
Assignee: jst → dom_bugs
Status: ASSIGNED → NEW
From what I read in the w3c mailing list and in the html4.01 spec, this should
not be allowed.
http://lists.w3.org/Archives/Public/www-html/2001Aug/0103.html
http://www.w3.org/TR/html401/types.html#type-links

It could become a new way to attach scripts in xhtml2, but nothing has been
decided on that issue.
If we do this, it might be nice to support 'alternate script' as well.
QA Contact: stummala → ian
Summary: <LINK rel="script" href="script.js" type="text/javascript" /> not working → <link rel="script" href="script.js" type="text/javascript" /> not working
I'm a webmaster and I'm little confused about the way that Mozilla parses empty
<script/> elements that refer to external scripts. I think it's ugly bug that
Mozilla doesn't see that's empty element instead of start element in XHTML. It's
unpleasant issue for webmasters.

I would be grateful if this bug is solved. :-)
The same is for <div id="forms_calendarDiv" />. Arghh! Is it for all empty elements?
Comment 9 and comment 10 are unrelated to this bug. You are sending your file
with the 'text/html' MIME type instead of the 'application/xhtml+xml' MIME type.
If you want more clarification you can contact me in private e-mail, please
don't spam this bug.
Nobody supports this (to my knowledge). Unless a good argument is made for ever
supporting this, I plan on making Web Apps 1.0 (HTML5) say that rel="script" is
not a valid value, and that <script ../> should be used instead.
I agree, but currently <script />  (self closing) doesn't work as expected either.
It does. You are mixing up XHTML with HTML. Make sure you read Appendix C of the
XHTML 1 specification first.
Whiteboard: WONTFIX per comment 12?
"Nobody supports this (to my knowledge). Unless a good argument is made for ever
supporting this, I plan on making Web Apps 1.0 (HTML5) say that rel="script" is
not a valid value, and that <script ../> should be used instead."

Yuck. Okay, good argument... good argument. How about consistancy? How about
generalisation? Generalisation helps with templates, scripts - both client and
server.
Consistency is a good argument when you're inventing something from scratch. But
here we already have deployed implementations and content, and the technique
used is <script src="">. Consistency doesn't outweigh that.

I don't understand the "generalisation" argument.

Instead of:

   if (stylesheet)
      <link rel="stylesheet" href="%s">
   else
      <link rel="script" href="%s">

...you just have:

   if (stylesheet)
      <link rel="stylesheet" href="%s">
   else
      <script src="%s"></script>

...which seems just as "general" for me.
How about:

myfunc(type,uri)
	<link rel="type" href="uri"/>
	
can be used to include many different types of file and makes, for example, XML
transformations simpler then XML is used in a CMS. I geuss I see it a bit like
image/object. Using the general Object is good. Creating elements for the
different types of documents you may like to embed is bad (why SVG has an image
element I don't know).
I don't understand where you would ever use that function without knowing
whether you were asking for a script or a stylesheet. And if you know, you can
just call the appropriate function instead of calling a generic function.

Invoking a stylesheet is a presentational thing.
Invoking a script is (often) more of a content thing.

The two things are different, I don't understand why a CMS would need the same
function for both.
It's just a general way to include external documents. I just feel it's cleaner,
more uniform. No big deal.

Why can we not include external CSS documents with <style src="my.css"
type="text/css"></style>?
This is not the right place to discuss these things. Mozilla implements
specifications, this is not in one of them. The most chance of success you have
here: <http://whatwg.org/mailing-list>. (Although there is probably no chance at
all as being backwards compatible is far more important and introducing new
features for the sake of it is not something that is likely to happen.)
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Component: DOM: HTML → DOM: Core & HTML
QA Contact: ian → general
Anne is correct.
Assignee: general → nobody
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.