0

Today I found HTML tag SCRIPT with two files in src seperated by pipe char.

What does it mean? Never before have I seen it.

It loads both files? Or only a.js, if a.js not exist then load b.js?

<script src="a.js|b.js" type="text/javascript" charset="utf-8"></script>
PeeHaa
  • 71,436
  • 58
  • 190
  • 262
martin
  • 1,707
  • 6
  • 34
  • 62
  • Where did you see that? – PeeHaa Oct 16 '15 at 07:56
  • First code example (beginning with` `) at page http://www.abclinuxu.cz/blog/mirecove_dristy/2015/9/reactor.js-moja-odpoved-na-reactjs – martin Oct 16 '15 at 09:42
  • 1
    They are comparing two libraries if google translate correctly translated the page. They did not mean to say you should include the libraries like that, but rather it's a means to tell the user to use on of the libraries. So either ` – PeeHaa Oct 16 '15 at 10:01

2 Answers2

1

The W3C specification does not mention such | special character, it says that

this attribute specifies the location of an external script.

As a consequence the content of this attribute should be interpreted by any browser as the URI of a single external script to be loaded.

In your example a.js|b.js will be interpreted as a single filename, and not two separate scripts.

sdabet
  • 18,360
  • 11
  • 89
  • 158
0

It means nothing special as far as the client is concerned. The URL is a.js|b.js and that is what the browser asks the server for.

It is possible that the particular server that is hosting that HTML document has a server side program which will interpret that URL to mean "Concatenate the contents of the files a.js and b.js and send the result back as the HTTP resource", but that's completely transparent to the client.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335