What is wrong with this code? Firefox won't show me page.
<html>
<head>
<hta:application border="none" singleinstance="yes" windowstate="maximize" scroll="yes" caption="no" innerborder="no">
</hta:application>
<style>
body {
background: black;
color: white;
font-family: Tahoma, Arial, Verdana;
scrollbar-face-color:Black;
scrollbar-arrow-color:FFFFE0;
scrollbar-track-color:#EEEEEE;
scrollbar-shadow-color:blue;
scrollbar-highlight-color:'';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}
h1 { /* Title */
font-size: 21px;
}
p {
font-size: 16px;
line-height: 125%;
}
td {
font-size: 16px;
}
#picture {
width: 200 px;
height: 330px;
overflow: hidden;
border: 2px solid #666666;
}
.button { /* Next / Prev and category buttons */
height: 15px;
padding-left: 16px;
padding-right: 16px;
border: 2px solid #666666;
font-weight: bold;
cursor: hand;
}
#list {
width: 204px;
overflow: hidden;
padding-right: 2px;
}
#counter { /* Movie number between next and prev */
width: 80px;
height: 15px;
font-weight: bold;
text-align: center;
}
#contentDiv { /* The area that contains the movies */
height: 850px;
overflow: hidden;
margin-top: 20px;
margin-bottom: 20px;
}
}
</style>
<script language="javaScript">
var movies = new Array();
var category = ""; // Current category
var movie = null; // Current movie
var categoryButton = null; // Active category button
var index = 0; // Current movie number in this category
var isReady = true; // Is ready for input from user
/*
* Gets called by body onload.
* Organizes all div elements with the attribute category in different arrays
* depending on category.
*/
function init() {
var elements = document.body.getElementsByTagName("div");
var catArray = null;
movies["Kaikki"] = new Array();
createCategory("Kaikki");
for (var i = 0; i < elements.length; i++) {
category = elements.category;
if (category != null && category != "") {
catArray = movies[category];
if (catArray == null) {
catArray = new Array();
movies[category] = catArray;
catArray[0] = elements;
createCategory(category);
} else {
catArray[catArray.length] = elements;
}
movies["Kaikki"][movies["Kaikki"].length] = elements;
}
}
category = "Kaikki";
showMovie(0);
}
/*
* Called by init()
* Writes the html code for a category button with given name
*/
function createCategory(name) {
html = "<span class='button' onclick='setCategory(\"" + name + "\")'>" + name + "</span>";
document.all.categoryDiv.innerHTML += html;
}
/*
* Called when the user presses a category button.
* Sets the category to the given value.
*/
function setCategory(name) {
if (!isReady) return;
category = name;
index = 0;
showMovie(index);
// Changes apperance of the pressed category button
if (categoryButton != null) {
categoryButton.style.borderColor = "#666666";
categoryButton.style.color = "white";
}
categoryButton = window.event.srcElement;
categoryButton.style.borderColor = "99FF00";
categoryButton.style.color = "99FF00";
}
function next() {
if (!isReady) return;
index++;
if (index >= movies[category].length)
index = 0;
showMovie(index);
}
function prev() {
if (!isReady) return;
index--;
if (index < 0)
index = movies[category].length - 1;
showMovie(index);
}
function SelMovie(i) {
Category="Kaikki";
i=i-1;
if (movie != null) {
movie.style.display = "none";
}
movie = movies[category];
movie.style.display = "inline";
document.all.picture.src = movie.img;
document.all.counter.innerHTML = (i+1) + "/" + movies[category].length;
}
function showMovie(i) {
if (movie != null) {
movie.style.display = "none";
}
movie = movies[category];
movie.style.display = "inline";
document.all.picture.src = movie.img;
document.all.counter.innerHTML = (i + 1) + "/" + movies[category].length;
}
</script>
</head>
--------cut-----
Firefox does not show me even the picture of a movie. Is it firefox or is it myt code that sux? Doesn't firefox understand javascript completely?
Template problem
I replaced that and now its working even worse if possible.antp wrote:Firefox understands Javascript, but not IEscript.
document.all.name does not exist in Javascript. You have to use document.getElementById('name') where name is labelled as id="name" in the HTML tag.
Can anyone recommend me some template that works with Firefox too.
anyone?Tuhma wrote:I replaced that and now its working even worse if possible.antp wrote:Firefox understands Javascript, but not IEscript.
document.all.name does not exist in Javascript. You have to use document.getElementById('name') where name is labelled as id="name" in the HTML tag.
Can anyone recommend me some template that works with Firefox too.