SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member Flanker's Avatar
    Join Date
    Apr 2006
    Location
    Paris, France
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [ask] AJAX - load formatted HTML text

    hi all..

    I do HTTP request to return a formatted text.

    example:

    Code:
    <p>what is this ? <strong>this sound good</strong> and very wellfor us..</p> <p>i dont seem to be able to handle it..</p>
    the problem is : the browser do not render the style. FF & IE just show the text as if - exactly like the code. do not apply the tag as style.

    anybody know how to get the text with its style ?

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2006
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are you displaying the text? What I usually do is have a target div in place, and update it's innerHTML property with the text sent from the server.

    Dave

  3. #3
    SitePoint Member Flanker's Avatar
    Join Date
    Apr 2006
    Location
    Paris, France
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i did that. but it did not load the style.

    the browser do not render the <strong></strong as bold. etc...

    iframe doesn't work either

    html code:

    <div id='content1'>
    </div>

    <iframe id='content2'>
    </iframe>
    js code :

    $('content1).innerHTML = $row[2];
    $('content2').innerHTML= $row[2];

  4. #4
    SitePoint Member Flanker's Avatar
    Join Date
    Apr 2006
    Location
    Paris, France
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i solve it.

    I use : html_entity_decode

    to decode the html.

    sorry for bothering


Bookmarks

Posting Permissions

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