How to embed a tweet from URL using jquery/json/oembed

I'm probably making this a lot hard than it should be, but I'm having a really difficult time finding a way to embed a tweet ( into a webpage dynamically. Ideally, I'd like to have a user enter a twitter status URL (like, click a button, and have the tweet embed in a div.

Here's what I've got so far:

    var url = $("#retweet_form_url").val();
    if (url==""){
    else {
            url: ""+url,
            dataType: "jsonp",
            success: function(data){
                // Derp! What do I do here? 

When I test this with a URL I do get a JSON response back from twitter than includes the entire HTML needed to embed the tweet, but when I try to parse it I can't get anything to appear in my div. Can anyone point me in the right direction?

Thanks in advance to any help you can offer!


data is an object containing the tweet details, including an html member containing the actual embed code. So:

// ...
   success: function(data){
// ...

Need Your Help

Android - Custom dynamically-generated compound View recreated in RecyclerView, causing poor performance

android performance android-layout android-view android-recyclerview

I'm using a custom CompoundView which extends LinearLayout to display items of a RecyclerView. Each item displays an article which contains multiple paragraphs and images. The CompoundView adds Tex...

How do I display an image with ltk?

lisp tcl tk sbcl ltk

I have written code to read a windows bitmap and would now like to display it with ltk. How can I construct an appropriate object? Is there such functionality in ltk? If not how can I do it directly