Request.JSONP

by rjurd

HTML

<div class='wrapper'>
    <p>JSONP is loaded from different domain</p>
    <ul id='post'></ul>
</div>

CSS

body {
    font-family: Helvetica, Sans, Arial;
}
p, ul {
    padding: 10px;
}
ul {
    margin: 5px;
    border: 2px dashed #999;
}

JavaScript

$.ajax({
    url: 'http://ijpweb.biz/tweetlist/json.php',
    dataType: "jsonp",
    success: function(data, textStatus, jqXHR) {
        console.log(data);
        //show_response(response, $('post'));
    }
});

show_response = function(obj, result) {
    /*
    $H(obj).each(function(v, k) {
        new Element('li', {
            text: k + ': ' + v
        }).inject(result);
    });
    result.highlight();
    */
};