Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten Ansicht
  #1  
Alt 24.02.06, 10:34
Forum Newbie
 
Registriert seit: 24.02.06
Ort: Berlin
Alter: 36
Beiträge: 24
Daviz eine Nachricht über ICQ schicken Daviz eine Nachricht über AIM schicken Daviz eine Nachricht über MSN schicken Daviz eine Nachricht über Skype™ schicken
JavaScript wird verfälscht

Hallo Typos,

ich versuche etwas JavaScript in den Head einzubinden. Leider wird bei der Ausgabe der Code so verfälscht das er nicth mehr läuft, bzw. einfach der ganze Rest der Seite auskommentiert wird.

Der Code so wie ich ihm im Template im Head stehen habe:
Code:
<script type="text/javascript">
/*<![CDATA[*/
<!--
	function MM_preloadImages() { //v3.0
	 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
//-->
/*]]>*/
</script>
Und so sieht er aus wenn Typo3 die Seite anzeigt:
Code:
<script type="text/javascript">
/*<![CDATA[*/
<!--
	function MM_preloadImages() { //v3.0
	 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i="" if="" aiindexof="0){" dmm_pj="new" image="" dmm_pjsrc="a[i];}}" --="">
/*]]>*/
</script>
Ich habe auch schon versucht den JS Code mittels
Typoscript-Code:
1:
2:
marks.POSITION = TEXT
marks.POSITION.value = <JavaScript.....>
einzufügen. Das Ergebnis ist aber leider das gleiche

Was mache ich falsch?


Viele Grüße,
David

Geändert von Junior (08.03.06 um 20:37 Uhr).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
Sponsored Links
  #2  
Alt 24.02.06, 11:34
Benutzerbild von lutz
TYPO3forum.net Donater
 
Registriert seit: 19.08.04
Beiträge: 579

Typoscript-Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
marks.POSITION = TEXT
marks.POSITION.value (
<script type="text/javascript">
/*<![CDATA[*/
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
/*]]>*/
</script>
)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #3  
Alt 24.02.06, 12:18
Forum Newbie
 
Registriert seit: 24.02.06
Ort: Berlin
Alter: 36
Beiträge: 24
Daviz eine Nachricht über ICQ schicken Daviz eine Nachricht über AIM schicken Daviz eine Nachricht über MSN schicken Daviz eine Nachricht über Skype™ schicken

Hallo Lutz, danke für deine Antwort.

So hatt ich es schon versucht. Sorry, habe ich wohl nicht deutlich genug geschrieben. <JavaScript.....> sollte der ganze JS Code sein

Naja, auch mit deiner Lösung mit den runden Klammern klappt es leider nicht. Die Ausgabe bleibt "gleich falsch".

Hier mal der Head meiner Seite mit der fehlerhaften Ausgabe:
Zitat:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<!--
This website is brought to you by TYPO3 - get.content.right
TYPO3 is a free open source Content Management Framework created by Kasper Skaarhoj and licensed under GNU/GPL.
TYPO3 is copyright 1998-2005 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
Information and contribution at http://www.typo3.com
-->


<title>Neudenkland</title>
<meta name="description" content="Neudenkland - Führungskräfteentwicklung" />
<meta name="keywords" content="Neudenkland, Führungskräftetraining, Teamentwicklung, Incentives, Coaching" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Author" content="Neudenkland: Conrad und Pfuhl" />
<style type="text/css">
<!--
@import url("fileadmin/neudenkland/css/screen.css");

#subnavigation
{
position: absolute;
width: 220px;
left: 35px;
top: 245px;
}
-->
</style>
<script type="text/javascript">
/*<![CDATA[*/
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i="" if="" aiindexof="0){" dmm_pj="new" image="" dmm_pjsrc="a[i];}}" --="">
/*]]>*/
</script>


<meta name="generator" content="TYPO3 3.8 CMS" />


</head>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #4  
Alt 24.02.06, 12:32
Benutzerbild von lutz
TYPO3forum.net Donater
 
Registriert seit: 19.08.04
Beiträge: 579

Zitat:
Zitat von Daviz
Naja, auch mit deiner Lösung mit den runden Klammern klappt es leider nicht. Die Ausgabe bleibt "gleich falsch".
Da gibt es wohl Deinerseits ein kleines Verständnisproblem.
Wenn etwas in den head-bereich rein soll, dann mußt Du es einfügen wie folgt (Beispiel:sad:
Typoscript-Code:
1:
2:
3:
4:
page.headerData.10 = TEXT
page.headerData.10.value (
...
)

Normalerweise wird der Head-Bereich Deines html-Templates doch überhaupt nicht übernommen, es sei denn, Du befiehlst es ausdrücklich.
Insofern solltest Du besser sowohl Dein gesamtes html-Template, als auch Dein gesamtes Typoscript posten, denn ansonsten redeten wir glorreich aneinander vorbei.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #5  
Alt 24.02.06, 13:08
Forum Newbie
 
Registriert seit: 24.02.06
Ort: Berlin
Alter: 36
Beiträge: 24
Daviz eine Nachricht über ICQ schicken Daviz eine Nachricht über AIM schicken Daviz eine Nachricht über MSN schicken Daviz eine Nachricht über Skype™ schicken

Okay, dann mal ausführlich

Mein TypoScript im Haupt-Tamplate:

Constants:
Typoscript-Code:
1:
2:
3:
position = 245
# Default Header auf h2 setzen
content.defaultHeaderType = 2

Setup:
Typoscript-Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
config {
xhtml_cleaning = all
doctype = xhtml_strict
removeDefaultJS = 1
noPageTitle = 2
}

lib.stdheader {
10.1.fontTag = <h1> | </h1>
10.2.fontTag = <h2> | </h2>
10.3.fontTag = <h3> | </h3>
10.4.fontTag = <h4> | </h4>
10.5.fontTag = <h5> | </h5>
}

# Main TEMPLATE cObject for the HEAD
temp.headTemplate = TEMPLATE
temp.headTemplate {
template = FILE
template.file = fileadmin/neudenkland/templates/index.htm
# Select only the content between the <head>-tags
workOnSubpart = head
marks.TITLE = TEXT
marks.TITLE.field = title
marks.POSITION = TEXT
marks.POSITION.value = {$position}
}

# Default PAGE object:
page = PAGE
page.typeNum = 0
# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate
# Copying the content from TEMPLATE for <head>-section:
page.headerData.10 < temp.headTemplate
# bodyTag individuell festlegen
page.bodyTag = <body onload="MM_preloadImages('fileadmin/neudenkland/images/buttons/navi-button-over-1.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-2.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-3.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-4.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-5.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-6.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-7.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-8.jpg')">
Das Basic Template wird noch mit eingebunden:
Typoscript-Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
template = FILE
template.file = fileadmin/neudenkland/templates/index.htm
# Select only the content between the <body>-tags
workOnSubpart = body
# SeitenTitle als h1-Überschrift einsetzen
marks.CONTENT_HEADER = TEXT
marks.CONTENT_HEADER.field = title
marks.CONTENT_HEADER.wrap = <h1>|</h1>
# Substitute the ###content### subpart with some example content:
subparts.CONTENT < styles.content.get

subparts.THEME_MENU < temp.naviLinks

subparts.TOP_MENU = HMENU
subparts.TOP_MENU {
special = list
special.value = 6, 5, 4, 3
1= TMENU
1 {
NO = 1
NO {
allWrap = | &nbsp;|&nbsp; |*| | &nbsp;|&nbsp; |*| |
}
ACT < .NO
ACT {
doNotLinkIt = 1
allWrap =  <span id="navi-oben-aktiv"> | </span>&nbsp;|&nbsp;
}
}
}

subparts.BOTTOM_MENU = HMENU
subparts.BOTTOM_MENU {
special = list
special.value = 19, 2
1 = TMENU
1 {
NO = 1
NO {
allWrap = | &nbsp;|&nbsp; |*| |  |*|
}
ACT < .NO
ACT {
doNotLinkIt = 1
allWrap =  <span id="navi-fuss-aktiv"> | </span>
}
}
}

}


Die HTML-Vorlage für das Template:
HTML-Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head><!--###head### begin --> <title>###TITLE###</title> <meta name="description" content="Neudenkland - Führungskräfteentwicklung" /> <meta name="keywords" content="Neudenkland, Führungskräftetraining, Teamentwicklung, Incentives, Coaching" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="Author" content="Neudenkland: Conrad und Pfuhl" /> <style type="text/css"> <!--
@import url("fileadmin/neudenkland/css/screen.css");

#subnavigation
{
	position: absolute;
	width: 220px;
	left: 35px; 
	top: ###POSITION###px;
}
--> </style> <!--###head### end --></head> <body onload="MM_preloadImages('fileadmin/neudenkland/images/buttons/navi-button-over-1.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-2.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-3.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-4.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-5.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-6.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-7.jpg','fileadmin/neudenkland/images/buttons/navi-button-over-8.jpg')"> <!--###body### begin --> <!-- DIV zentriert gesamten Inhalt der Seite --> <div id="center-box"> <!-- Images oben im Kopf --> <!--###images-oben### begin --> <img alt="Bild1" src="fileadmin/neudenkland/images/head/1.jpg" id="bild1" /> <img alt="Bild2" src="fileadmin/neudenkland/images/head/2.jpg" id="bild2" /> <img alt="Bild3" src="fileadmin/neudenkland/images/head/3.jpg" id="bild3" /> <!--###images-oben### end --> <!-- Navigation oben - Thema: Firma --> <div id="navi-oben"> <!--###TOP_MENU### begin --> <a href="#">Philosophie</a> | <a href="#">Team</a> | <a href="#">Partner</a> | <a href="#">Kontakt</a> <!--###TOP_MENU### end --> </div> <!-- Navigation links --> <div id="themen-navigation"> <!--###THEME_MENU### begin -->
.
.
.

<!--###body### end --> </body> </html>
Das TypoScript für das Menü links ###THEME_MENU### habe ich mir jetzt gespart. Das sind nochmal 100 Zeilen Code. Ich denke die sind nicht relevant. Es werden dort mehrere COA-Objekte erzeugt, je nach dem welche ID die aktive Seite hat.

Name des COA-Objekts ist temp.naviLinks.


Ich hoffe die Informationen helfen weiter.

Danke für die Mühe,
David

Geändert von Junior (25.02.06 um 14:58 Uhr).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #6  
Alt 07.03.06, 16:07
Forum Newbie
 
Registriert seit: 24.02.06
Ort: Berlin
Alter: 36
Beiträge: 24
Daviz eine Nachricht über ICQ schicken Daviz eine Nachricht über AIM schicken Daviz eine Nachricht über MSN schicken Daviz eine Nachricht über Skype™ schicken

Da ich den Grund der merkwürdigen Ausgabe nicht gefunden habe, habe ich das JavaScript in eine Datei ausgelagert und dann im Head meines Templates per
HTML-Code:
<script src="fileadmin/neudenkland/scripts/preloadImages.js" type="text/javascript"></script>
eingefügt.

Danke an alle für eure Hilfe!

Liebe Grüße,
David
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #7  
Alt 11.05.06, 11:48
Forum Newbie
 
Registriert seit: 09.02.06
Ort: Wien
Beiträge: 37
cbalogh eine Nachricht über Skype™ schicken

hallo,

ich hatte dasselbe problem. der grund für die merkwürdige ausgabe liegt in der javascript bedingung ...i<a.length. typo3 erkennt irgendwie das <a als <a>-tag und fummelt dann im code der dahinter steht rum. die lösung ist relativ simpel: durch einfügen eines leerzeichens zwischen den operator und das a ist der fehler behoben.

<script type="text/javascript">
/*<![CDATA[*/
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i< a.length; i="" if="" aiindexof="0){" dmm_pj="new" image="" dmm_pjsrc="a[i];}}" --="">
/*]]>*/
</script>

dann klappt es auch.
lg
c
__________________
SuSE 9.0 | Apache 1.3.28 | PHP 4.3.3. | MySQL 4.0.15 | Typo3 3.8.0
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #8  
Alt 11.05.06, 12:12
Forum Newbie
 
Registriert seit: 24.02.06
Ort: Berlin
Alter: 36
Beiträge: 24
Daviz eine Nachricht über ICQ schicken Daviz eine Nachricht über AIM schicken Daviz eine Nachricht über MSN schicken Daviz eine Nachricht über Skype™ schicken

Hallo cbalogh,


klasse das ich doch noch eine Erklärung für dieses Phänomen bekommen habe!

Und vor allem so eine "einfache" Lösung...wenn es weiss.


Viele liebe Grüße,
David
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
Antwort


Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge anzufügen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

vB Code ist An.
Smileys sind An.
[IMG] Code ist An.
HTML-Code ist Aus.
Trackbacks are An
Pingbacks are An
Refbacks are An


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Javascript alkativo TYPO3 3.x Fragen und Probleme 1 24.09.07 13:40
javascript auslagern Dr.Schmidt TYPO3 4.x Fragen und Probleme 15 02.04.07 16:01
Javascript Menü Merlin78 GMENU, HMENU, TMENU und Co. 0 08.09.06 09:38
Formular mit Javascript dstev TYPO3 3.x Fragen und Probleme 1 19.02.06 17:43
Javascript einbinden Nacoya Tarsk TYPO3 3.x Fragen und Probleme 2 08.10.05 18:26


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:14 Uhr.


Powered by vBulletin® Version 3.6.8 Patch Level 2 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Template-Modifikationen durch TMS