Forum Moderators: open

Message Too Old, No Replies

Sending HTML markup in an XML response

what the "<" is that?

         

dhiggerdhigger

11:40 am on Feb 9, 2006 (gmt 0)

10+ Year Member



A user submits a form, and Ajax ensues. An XML response is created, and sent back to browser. But no! The feedback in my XML response is truncated! The xmlresponse looks like this (generated in php)

<?php
header('Content-type: text/xml');
$feedback = "See <a href=\"http://www.example.com\">this</a>!";
?>
<xmlresponse>
<verdict><?= $feedback?></verdict>
</xmlresponse>

The Ajax functionality is working fine, except that any text sent back in <verdict> ends at the first "<" of the link.

Can I send html markup?
Can I make sure that the markup is parsed (not just displayed) when it hits the browser?

Iguana

10:02 am on Feb 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've not used Ajax but I'll try and help.

To try to get the browser to parse the xml you may have to write to the innerHTML property of an element (easy in Javascript).

jitendrasinghjat

6:49 am on Feb 11, 2006 (gmt 0)

10+ Year Member



thanks for script