Griffo Posted January 30, 2007 Share Posted January 30, 2007 HiIm using AJAX to read characters from a text box, search an array for words that begin with that character, then return all matching words to the HTML page.This works fine in IE7 and Firefox 2But when I try to return formatted results, something like <ul>a word</ul> , IE7 throws up an "Unknown runtime error" and points to the section of javascript belowfunction stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ document.getElementById("txtHint").innerHTML=xmlHttp.responseText } } Firefox displays what i am trying to do perfectlyAny ideas why this is and what i can do to sort it out??Thanks Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted January 30, 2007 Share Posted January 30, 2007 What kind of element is txtHint?And are you sure you don't mean:if(xmlHttp.readyState == 4 && xmlHttp.status == 200)I only ask the second question because I'm new to AJAX and that's what the tutorial I read had in it. Quote Link to comment Share on other sites More sharing options...
Griffo Posted January 30, 2007 Author Share Posted January 30, 2007 txtHint is currently a <span> element but willbe changing it to a <div> at some point.The code ive got is part of a tutorial from the W3C site, as i have mentioned it works fine until you try to pass HTML tags back. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted February 11, 2007 Share Posted February 11, 2007 an 'unordered list' item is a block level item, whereas a span is an inline element. Block level items are invalid inside inline items. Funny ff didn't complain as well .Change your item from a span to a div and then retest. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.