0

I'm using the below code. it's working fine

    $.each(data, function (index, d) {
        var clippy_swf = "swf/clippy.swf";
        $('#change_this').html('').clippy({ 'text': d.address_1, clippy_path: clippy_swf });
    });

but i'm trying to like this, it's not working here.

    $.each(data, function (index, d) {
        if (index != 0) {
            multiaddr += "<div><span >" + d.address_1 + "</span><span id='change_this_" + index + "'></span></div>";
            var clippy_swf = "swf/clippy.swf";
            $("#change_this_" + index + "").html('').clippy({ 'text': d.address_1, clippy_path: clippy_swf });
        }
    });
1
  • How to bind clippy event on dynamically created span?? Commented Jan 14, 2014 at 17:14

2 Answers 2

1

try this:

    $('.someclass').append(multiaddr);
    $(document).find("#change_this_" + index + ").html('').clippy({ 'text': d.address_1, clippy_path: clippy_swf });

Instead of:

$("#change_this_" + index + "").html('').clippy({ 'text': d.address_1, clippy_path: clippy_swf });

You have too many " after index and try to find your new div inside document but you need to add it before

Sign up to request clarification or add additional context in comments.

1 Comment

perfect remind to accept the answer when you can to help other person with your same problem :) @RohitKhurana
0

try clippy https://github.com/mojombo/clippy its simple and easy. works on all browsers expect it depends on flash so it wont work in mobile browsers

Its what github uses

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.