dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: AJAX - Pass in HTML Tags

  1. #1
    Join Date
    Jul 2011
    Posts
    8

    AJAX - Pass in HTML Tags

    I am trying to create an AJAX website. The content that will be updated is text description of the product. I am wondering how would I be able to add HTML tags within the content of my XML?

    For example, ProductA.XML:
    Code:
    <product>
    	<description>This product was inspired by <a href="jason.html">Jason</a></description>
    </product>
    To be clear, I am using AJAX to retrieve XML documents. The XML will be formatted via XSL. Is this the correct format?

  2. #2
    Join Date
    Feb 2003
    Location
    Michigan, USA
    Posts
    5,774

  3. #3
    Join Date
    Jul 2011
    Posts
    8
    I have tried the following with CData but I have had no luck. Am I doing something wrong?

    Code:
    <description> <![CDATA[ Product A is inspired by <a href="http://www.google.ca/">Google</a>. ]]> </description>
    
    <![CDATA[  <description>  Product C is inspired by <a href="http://www.google.ca/">Google</a>. </description> ]]>
    I have uploaded a sample of my project here:
    http://www.sfu.ca/~jca41/stuph/tst/template.html
    http://www.sfu.ca/~jca41/stuph/tst/

  4. #4
    Join Date
    Jul 2011
    Posts
    8
    Problem solved. CData is not compatible with Firefox. The better solution is to use the following piece of code. Make sure the HTML you are passing in is valid XHTML though.

    Code:
    <xsl:copy-of select="content/description" />

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles