IE viser billeder, men FF ikke
Jeg er ved at brygge en lille kalender sammen, og i den forbindelse, vil jeg have noget gfx, til at man kan "spole" frem og tilbage i år og måned.Mit problem er så, at IE viser billederne fint, men ikke FF. Eksempel:
http://martin8.wi8.ots.dk/calendar/dato_test.php (tryk på test hehe).
JavaScript koden er som følger:
====================================================
function openCalWindow(selectYearRange)
{
calWindow = window.open('', '', 'width=630, height=400, status=0');
var rootDoc = calWindow.document.documentElement;
var headElm = rootDoc.getElementsByTagName(rootDoc.childNodes[0].tagName)[0];
var bodyElm = rootDoc.getElementsByTagName(rootDoc.childNodes[1].tagName)[0];
if (bodyElm.firstChild) {
bodyElm.removeChild(bodyElm.firstChild); }
var scrElm = calWindow.document.createElement('script');
scrElm.setAttribute('type', 'text/javascript');
scrElm.setAttribute('src', 'scripts/kalender.js');
headElm.appendChild(scrElm);
var calContain = calWindow.document.createElement('div');
calContain.setAttribute('id', 'calendar');
bodyElm.appendChild(calContain);
buildCalendarTop(calWindow, selectYearRange);
buildCalendarMatrix(calWindow, 1);
calWindow.focus();
}
function buildCalendarTop(calWindow, selectYearRange)
{
var mainElm = calWindow.document.getElementById('calendar');
var selectYearStart = selectYearRange.split('-')[0];
var selectYearEnd = selectYearRange.split('-')[1];
var monthBack = calWindow.document.createElement('img');
monthBack.setAttribute('src', 'scripts/gfx/monthBackUp.gif');
monthBack.setAttribute('onmousedown', 'this.src = "scripts/gfx/monthBackDown.gif"');
monthBack.setAttribute('onmouseup', 'this.src = "scripts/gfx/monthBackUp.gif"');
monthBack.setAttribute('onclick', ''); // HUSK HUSK HUSK
var yearBack = calWindow.document.createElement('img');
yearBack.setAttribute('src', 'scripts/gfx/yearBackUp.gif');
yearBack.setAttribute('onmousedown', 'this.src = "scripts/gfx/yearBackDown.gif"');
yearBack.setAttribute('onmouseup', 'this.src = "scripts/gfx/yearBackUp.gif"');
yearBack.setAttribute('onclick', ''); // HUSK HUSK HUSK
var selectYear = calWindow.document.createElement('select');
selectYear.setAttribute('id', 'selectYear');
selectYear.setAttribute('onchange', ''); // HUSK HUSK HUSK
var selectMonth = calWindow.document.createElement('select');
selectMonth.setAttribute('id', 'selectMonth');
selectMonth.setAttribute('onchange', ''); // HUSK HUSK HUSK
for(i=selectYearStart; i<=selectYearEnd; i++)
{
var opt = calWindow.document.createElement('option');
opt.text = i;
opt.value = i;
try {
selectYear.add(opt, null)
} catch (e) {
selectYear.add(opt)
}
}
for(i=0; i<=11; i++)
{
var opt = calWindow.document.createElement('option');
opt.text = setMonthName(i);
opt.value = i;
try {
selectMonth.add(opt, null)
} catch (e) {
selectMonth.add(opt)
}
}
var yearForward = calWindow.document.createElement('img');
yearForward.setAttribute('src', 'scripts/gfx/yearForwardUp.gif');
//yearForward.setAttribute('alt', '1 år frem');
yearForward.setAttribute('onmousedown', 'this.src = "scripts/gfx/yearForwardDown.gif"');
yearForward.setAttribute('onmouseup', 'this.src = "scripts/gfx/yearForwardUp.gif"');
yearForward.setAttribute('onclick', ''); // HUSK HUSK HUSK
var monthForward = calWindow.document.createElement('img');
monthForward.setAttribute('src', 'scripts/gfx/monthForwardUp.gif');
monthForward.setAttribute('onmousedown', 'this.src = "scripts/gfx/monthForwardDown.gif"');
monthForward.setAttribute('onmouseup', 'this.src = "scripts/gfx/monthForwardUp.gif"');
monthForward.setAttribute('onclick', ''); // HUSK HUSK HUSK
mainElm.appendChild(monthBack);
mainElm.appendChild(yearBack);
mainElm.appendChild(selectYear);
mainElm.appendChild(selectMonth);
mainElm.appendChild(yearForward);
mainElm.appendChild(monthForward);
}
====================================================
openCalWindow() er så den funktion der eksekveres, når man trykker på Test på siden.
Jeg kan simpelthen ikke se, hvad problemet skulle være:)
