Print Page | Close Window

AJAX and HTML entities

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21321
Printed Date: 29 March 2026 at 3:11am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: AJAX and HTML entities
Posted By: EarlyBird
Subject: AJAX and HTML entities
Date Posted: 17 September 2006 at 5:27am
Hi everyone! I'm trying to develop a new site with AJAX features. One of the features allows members to refresh the content of specific panels on the page. This all works well importing XHTML snippets using AJAX, but as soon as it includes any HTML entities like » the whole thing fails. It's returning the correct code (I tested it with an alert) but when I insert it into the div the HTML entities cause it to not display in Firefox and return a script error in IE. Anyone know how I can use HTML entities in my AJAX XML responses?



Replies:
Posted By: WebWiz-Bruce
Date Posted: 17 September 2006 at 9:07am
This may not work but it could be the ; coursing the issue in javascript and may need to be escaped try changing ; to the following:-

\;

This should escape the character and hopefully stop the javascript error


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: EarlyBird
Date Posted: 17 September 2006 at 12:42pm
No joy with that one i'm afraid. Apparently it's to do with the fact that these HTML entities aren't declared within the scope of the XML i'm using to return my XHTML. When the parser sees the entities it throws a fit because it doesn't recognise them.

As these characters can have been input by members of my site, the only way I can think of is by creating a doctype for my XML files that includes all of the HTML entities from the W3C site, but I have no idea how to go about it!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net