Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Ajax i pobieranie xml'a z php
filo
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 18.12.2007

Ostrzeżenie: (0%)
-----


Witam, mam następujący problem. Gdy wyodrębnie potomków obiektu <response> w poniższy sposób, kod zadzaiała pod Operą & FF, natomiast już nie pod IE (IMG:http://forum.php.pl/style_emoticons/default/blink.gif) . Gdyby zrobić to tylko jako <response> bez potomków, jako jeden ciąg znaków działa bez problemu.. chodzi o to że php zwraca mi więcej niż jedną wartość i zależy mi na tym aby były one rozdzielone, więc 'działający sposób' odpada..

jak sprawić aby poniższy kod zadziałał również pod IE? lub jak inaczej pobrać potomków obiektu <response>?

...

//wyodrębnia wiadomosc xml z serv.
xmlResponse = xmlHttp.responseXML;

//pobiera el. glowny ze struktury xml
xmlDocumentElement = xmlResponse.documentElement;



tilesizeArray = xmlDocumentElement.getElementsByTagName("tilesize");
tilesize_todisplay = tilesizeArray.item(0).firstChild.data;

crownheightArray = xmlDocumentElement.getElementsByTagName("crownheight");
crownheight_todisplay = crownheightArray.item(0).firstChild.data;

crownangleArray = xmlDocumentElement.getElementsByTagName("crownangle");
crownangle_todisplay = crownangleArray.item(0).firstChild.data;

baseheightArray = xmlDocumentElement.getElementsByTagName("baseheight");
baseheight_todisplay = baseheightArray.item(0).firstChild.data;

baseangleArray = xmlDocumentElement.getElementsByTagName("baseangle");
baseangle_todisplay = baseangleArray.item(0).firstChild.data;

warningArray = xmlDocumentElement.getElementsByTagName("warning");
warning_todisplay = warningArray.item(0).firstChild.data;



document.getElementById("divTileSize").innerHTML ='<i><font color="red">' + tilesize_todisplay + '</font>% </i>';
document.getElementById("divCrownHeight").innerHTML ='<i><font color="red">' + crownheight_todisplay + ' </font>% </i>';
document.getElementById("divCrownAngle").innerHTML ='<i><font color="red">' + crownangle_todisplay + '</font>&deg</i>';
document.getElementById("divBaseHeight").innerHTML ='<i><font color="red">' + baseheight_todisplay + ' </font>% </i>';
document.getElementById("divBaseAngle").innerHTML ='<i><font color="red">' + baseangle_todisplay + ' </font>&deg </i>';
document.getElementById("divWarning").innerHTML = '<i><font color="red">' + warning_todisplay + ' </font></i>';

...

z góry dzięki za pomoc! pozdrawiam. (IMG:http://forum.php.pl/style_emoticons/default/snitch.gif)

Ten post edytował filo 19.12.2007, 02:51:14
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.12.2025 - 16:06