ted_chou12 Posted October 1, 2010 Share Posted October 1, 2010 Hi, im trying to build a dynamic page, and for some reason, I had to set the response text equal to the innerhtml and find out whether if they are equal or not, if equal no action if not equall update page. BUT, I found out that despite my response text are <br />, the innerHtml replaced is converted to <br> automatically, I have been used to have <br />, since it is more of the "correct" way to enclose the tags that does not have an end tag on eg </script>, </table> </div>...etc. Anyone know a solution to this problem? or the only way is just to str.replace it? Thanks, Ted Quote Link to comment https://forums.phpfreaks.com/topic/214954-ajax-automatically-deletes-the-close-tags-on/ Share on other sites More sharing options...
trq Posted October 2, 2010 Share Posted October 2, 2010 I have been used to have <br />, since it is more of the "correct" way to enclose the tags that does not have an end tag on Only if your pages are xhtml. Anyway, we need to see some code in order to understand what your actually talking about. Quote Link to comment https://forums.phpfreaks.com/topic/214954-ajax-automatically-deletes-the-close-tags-on/#findComment-1118199 Share on other sites More sharing options...
ted_chou12 Posted October 2, 2010 Author Share Posted October 2, 2010 im attempting to replace the strings with the closed tags with javascript var text = ajaxRequest.responseText.replace("/\s*\/\s*>/", ">"); don't know why the text that comes out is still with <br /> thanks Quote Link to comment https://forums.phpfreaks.com/topic/214954-ajax-automatically-deletes-the-close-tags-on/#findComment-1118245 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.