<script type="text/javascript">     
        var loadInfo = function(videoId) {
            var gdata = document.createElement("script");
            gdata.src = "http://gdata.youtube.com/feeds/api/videos/" + videoId
                    + "?v=2&alt=jsonc&callback=storeInfo";
            var body = document.getElementsByTagName("body")[0];
            body.appendChild(gdata);
        };

        var storeInfo = function(info) {
            console.log(info.data.title);
        };
</script>

 

---------------------
Then you just need to call loadInfo(videoId)

arrow
arrow
    全站熱搜

    cabuchi 發表在 痞客邦 留言(0) 人氣()