A local html file, lets says its path is /path/to/file.html. Has the following at the start.
<html>
<head>
<link rel="shortcut icon" href="logo.ico"/>
<LINK href="1.css" rel="stylesheet" type="text/css" />
<script src="1.js" type="text/javascript"> </script>
</head>
<body class = "body_background">
.
.
.
when tries to open it in a browser using its full path:
The file name along with its extension ( file.html ) gets replaced by a JavaScript function.
i.e.
file:///path/to/file.html
gets changed to the following: The file name with its extension gets replace by the function location located in 1.js.
file:///path/to/function location() { …
The JavaScript file has this at the beginning:
if(window.addEventListener) {
window.addEventListener('load', location, false);
}
else if (window.attachEvent) window.attachEvent('onload', location);
This is happening on FireFox and Safari not on Chrome through.
On Chrome the page gets displayed appropriately.
This question is for a friend.
locationis a reserved word in some JS implementations, as indocument.location.See: http://www.javascripter.net/faq/reserved.htm