Forum Moderators: open
<script type="text/JavaScript" src="http://cache.example.com/abcdefg/spods.js?locale=en_US"></script>
<script type="text/JavaScript">
//<![CDATA[
for (var i = 0, n = wfSPODArray.length; i < n; i++) {
var spod = wfSPODArray[i];
spodHtml = '<a href=' + spod.link + ' target=_blank><img src=' + spod.photo.url + ' width=120' +' height=120 border=0' + '></a><br />' + '<a href=' + spod.link + ' target=_blank>' + spod.nickname + '</a>' + '<br />' + spod.quote + '<br />'
document.write(spodHtml);
}
//]]>
</script>
Can someone talk me through a different method of doing this, to make it work in an XHTML 1.1 document with .xhtml extension and MIME?
[edited by: Asia_Expat at 5:26 pm (utc) on Aug. 7, 2007]
document.getElementById('foo').innerHTML = 'your string here';
Or, simply do not use XHTML as it is broken [webmasterworld.com]. Switch to HTML 4.01 is my firm recommendation.
there is no way around it - because it is a feature of XHTML. if you want to write something to the page then you have to do it the long-winded way - inserting all the nodes and elements separately.
sometimes it is too much hassle to do that, and it's easier to serve XHTML as text/html.