How to recover json

Asked

Viewed 22 times

1

<script type="text/javascript">
    $(".addTrack").live('click', function() {

        $('.playerTocador').css('display', 'block');

        var mp31 = $(this).attr( & quot; data - servidor & quot;);
        var session = $(this).attr( & quot; data - session & quot;);

        jQuery.ajax({
            url: & quot;http: //www.mediafire.com/api/1.5/file/get_links.php?link_type=direct_download&amp;quick_key=&quot;+mp31+&quot;&amp;session_token=&quot;+session+&quot;&amp;response_format=json&quot;, //URL de destino
                dataType: & quot;json & quot;, //Tipo de Retorno
            success: function(json) { //Se ocorrer tudo certo
                var msg = & quot;
                direct_download: & quot; + json.response[ & #39;direct_download&# 39;] + & quot;\
                n & quot;;
                alert(msg);
            }
        });
    });

</script>

Ex.: I need "direct_download"

resultado: {
    "response": {
        "action": "file\/get_links",
        "links": [{
            "quickkey": "xf4d9nndyzg79cq",
            "direct_download": "http:\/\/download1326.mediafire.com\/csl7scdkjvkg\/xf4d9nndyzg79cq\/01-+Alo+Amor+-+Calcinha+Preta.mp3"
        }],
        "direct_download_free_bandwidth": "3128",
        "result": "Success",
        "current_api_version": "1.5"
    }
}

Thank you

  • Can you [Edit] the question and join code without turning it into HTML entities? join how you have it in the code we help to format...

  • Just go to the Internet: console.log(json.response.links[0].direct_download);, Alo love panties black.mp3? haushausahsa

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.