Microsoft
Software
Hardware
Network
Question : Ajax xmlObj.getElementsByTagNam<wbr />e displays text, not images
AJAX: I am using these line of JavaScript to alter the content in a div called "xtras" (a server side PHP script actually generates the XML content)
var html = xmlObj.getElementsByTagNam
e('result'
).item(0).
firstChild
.data;
document.getElementById('x
tras').inn
erHTML = html;
I seem to be getting the XML back from the PHP script fine - Firebug displays the response correctly.
CASE 1 (successful):
If I set the PHP script to return this:
$strMsg = 'BOO!';
header('Content-Type: text/xml');
header('Pragma: no-cache');
echo '';
echo '
';
echo $strMsg;
echo '
';
Firebug shows that the response received was this:
BOO!lt>
and the div "xtras" has its content updated successfully. "BOO!"
CASE 2 (failure):
If I set the PHP script to return this:
$strMsg = '
More images of the SLC-T2
Available with up to 4 tiers of LEDs
';
header('Content-Type: text/xml');
header('Pragma: no-cache');
echo '';
echo '
';
echo $strMsg;
echo '
';
Firebug shows that the response received was this:
More images of the SLC-T2
Available with up to 4 tiers of LEDs
But the content of the div "xtras" is empty! No error messages generated. Even if the image paths were wrong (thery're not), I should get the caption text at least.
Any assistance welcomed. Yerfdoggy
Answer : Ajax xmlObj.getElementsByTagNam<wbr />e displays text, not images
You send XML and expect to see HTML, right?
Random Solutions
Hardest SEO Job Questions
Bash scripting question - Creating a Loop and using a 'dynamic' variable
Seeking simple instructions on how to set up a Skype conference call
Windows Mobile Phone - how to sync pop email?
How Can an Admin Grant Read Permissions to Another User's Mailbox?
Broadcom internal bluetooth driver installed ok but no "Buke Devices"
Outlook Send on Behalf permission without giving access to the mailbox
Replacing a "&" in database. Getting errror
readyboost quit working on a "ready-boost capable device", suddenly
Mail Merge in Outlook 2007