SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist stonedeft's Avatar
    Join Date
    Aug 2009
    Posts
    586
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery replace with not working in IE

    Hello Forums.

    I'm trying to replace a p- classed element using jquery replaceWith() function but somehow it doesn't work in IE only (IE sucks!)

    Code JavaScript:
    var latest = $("#msg").val();
    $("div#mess .wenks").replaceWith("<p class=\"wenks\">"+latest+"</p>");

    Here is the link to my work file please have a look I must be missing something real significant here.

    http://www.i-mediaconcepts.net/jq

    I want to replace <p class="wenks">content</p> inside the #mess div with the latest entry.

    Thanks


    PS: this is from the sitepoint articles: Easy Ajax with JQuery http://articles.sitepoint.com/article/ajax-jquery/2
    Don't Panic

  2. #2
    SitePoint Evangelist stonedeft's Avatar
    Join Date
    Aug 2009
    Posts
    586
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind I got it I installed the developer's tool on IE and found out the string to replace is empty and I need to put replace function before

    Code Java:
    $("#msg").empty();

    Cheers !
    Don't Panic


Tags for this Thread

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
  •