If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Localhost HTML5 Javascript createElement("link")

RESOLVED INVALID

Status

()

Firefox
Untriaged
RESOLVED INVALID
4 years ago
4 years ago

People

(Reporter: Guillermo Céspedes Tabárez, Unassigned)

Tracking

23 Branch
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 801572 [details]
bug-localhost-html5-js-css.zip

User Agent: Mozilla/5.0 (X11; Linux i686; rv:23.0) Gecko/20100101 Firefox/23.0 (Beta/Release)
Build ID: 20130820224636

Steps to reproduce:

The problem only occurs on a localhost server.

1- Create an html file
2- Insert the following code:

<!DOCTYPE html>
<html>
	<head>
		<script type="text/JavaScript" data-cfasync="false">
			(function() {
			var nomarch = 'css/mycssfile';
			var d = new Date();
			var cssLink=document.createElement("link");
			cssLink.rel = "stylesheet";
			cssLink.type = "text/css";
			cssLink.href = nomarch+".css?rnd="+d.getTime();
			cssLink.crossOrigin = "Anonymous";
			cssLink.media = "all";
			document.getElementsByTagName("head")[0].appendChild(cssLink);
			})();
		</script>
	</head>
	<body>
	</body>
</html>

3 - Create a css file to test the code.  .../css/mycssfile.css
4 - Insert some element within the body with some css class


Actual results:

Do not load the css, firebug shows the element created, but the css does not work.

If we remove the doctype, the code works.

The problem only occurs on a localhost server, html5 somehow behaves differently in localhost environment.


Expected results:

That the css code is loaded and that it works.
(Reporter)

Comment 1

4 years ago
The problem was in the configuration of apache server.

missing add this code to httpd.conf:


<Directory "/home/dertin/www">

Options Indexes MultiViews +FollowSymlinks +SymLinksIfOwnerMatch
AllowOverride All
Order allow,deny
Allow from all

</Directory>
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.