You are not logged in.

wcf.regNote.message

Snoopy

Trainee

  • "Snoopy" started this thread

Posts: 57

  • Send private message

1

Wednesday, April 20th 2005, 2:42pm

document.body.innerHTML

Ich habe follgendes Problem.
Ich erstelle ein Template mit einem IFRAME.

PHP Source code

1
<iframe id="iView" style="width: 100%; height:220" src="email.php?frompopup=1&amp;mailid=$mailid&amp;using=$using&amp;noeditor=$noeditor&amp;what=$what&amp;html=on2&amp;whoget=$whoget"></iframe>

Von PHP aus schreibe ich nun einen "header" in den Inhalt des IFRAMES:

PHP Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if ($html == "on2") {
echo "<html><head></head><style type='text/css'>body {\n";
echo "color: #FFFFFF;\n";
echo "background-color: #002C52;\n";
echo "background-image : url(image/bg_input.gif);\n";
echo "overflow:auto;\n";
echo "background-repeat:repeat-y;\n";
echo "background-position: center;\n";
echo "background-attachment: fixed;\n";
echo "}\n";
echo "</style><body><div>";
echo test
echo "</div></body></html>";
exit();
}

Der Effekt sollte klar sein - ich habe nun eine Hintergrundgrafik im IFRAME.
Nun möchte ich aber über einen Button den Inhalt des IFRAMES an PHP übergeben:

PHP Source code

1
document.readmailform.text.value iView.document.body.innerHTML;
soweit so gut.
Allerdings wird mir nur der Text den ich schreibe ausgegeben - und mit "outerHTML" bekomme ich mein Style auch nicht.

Gibt es da generell keine Möglichkeit oder muss ich dafür extrem viel tricksen ?

thx.
Snoopy

Snoopy

Trainee

  • "Snoopy" started this thread

Posts: 57

  • Send private message

2

Wednesday, April 20th 2005, 3:17pm

RE: document.body.innerHTML

Könnte sich erledigt haben, habe das STYLE nach dem BODY gesetzt.

Ephraim

Professional

Posts: 826

Location: coder-board.info

Occupation: Info-Student

  • Send private message

3

Wednesday, April 20th 2005, 7:39pm

Du hättest dem Style, wenns dir nur um des Style geht, auch ne Id geben können und it document.getElementById dir des style holen und dann die Werte die brauchst direkt an PHP übergeben können ...

Dann sparst du dir das Parsen vom Body ....

Ciao Ephraim

wcf.user.socialbookmarks.titel