base html tag does not apply correctly to all javascript and style files

Problem: The

<base href="">

  did not work at all on Internet Explorer – no javascript or style files were loaded and worked partially in Mozilla Firefox – a few javascript files were not pointing to the path that should be transformed by base href attribute.


[0] => 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="">
<link rel="stylesheet" href="./css/styles.css" type="text/css" />
<scrupt src="./js/jquery.js" type="text/javascript"></script>
<scrupt src="./js/j1.js" type="text/javascript"></script>
<scrupt src="./js/j2.js" type="text/javascript"></script>

This code produced a page with no style files and  no javascript files included in Interenet Explorer 8 and a few javascript files (j1.js and j2.js) were not included in Firefox 3.5 because base tag was not applied. After several tests and all kind of different arrangements we discovered that the problem was the output before the page source the

Array ...


Solution: no output before the page’s headers otherwise you can get all kind of strange results including a html base tag not working correctly.