[TYPO3] JavaScript parse error

Livius Agrippa livius_agrippa at yahoo.com
Sun Dec 17 23:42:27 CET 2006


Hi,

I try to insert a JavaScript code inside my template because I want that
on the first page every 5 secs another image to be shown and also
depending on the screen resolution.

My code works fine in a static page but when I insert this code in Typo3
template the source output of my page is strange.

This JavaScript code:
if ((screen.width >=1152) && (screen.width <1280)){
image_list[image_index++] = new
imageItem("startseite/1152/ibtweb_startbild_1.gif");
image_list[image_index++] = new
imageItem("startseite/1152/ibtweb_startbild_2.jpg");
}
if ((screen.width >=1280) && (screen.width <1600)) {
image_list[image_index++] = new
imageItem("fileadmin/template/startseite/1280/ibtweb_startbild_1.gif");
image_list[image_index++] = new
imageItem("fileadmin/template/startseite/1280/ibtweb_startbild_2.jpg");
}

is parsed in this way:
if ((screen.width >=1152) && (screen.width <1280)){
image_listimage_index="new"
imageitemstartseite1152ibtweb_startbild_1gif=""
imageitemstartseite1152ibtweb_startbild_2jpg="" if=""
screenwidth="">=1280) && (screen.width <1600))
image_listimage_index="new"
imageitemfileadmintemplatestartseite1280ibtweb_startbild_1gif=""
imageitemfileadmintemplatestartseite1280ibtweb_startbild_2jpg=""

I don't have any idea and I hope that someone knows a solution for this.

Thank you in advance,
Livius


More information about the TYPO3-english mailing list