Add javascript variable to javascript src?

后端 未结 5 807
暗喜
暗喜 2021-01-19 19:38

this may sound a bit noobish, but I\'m trying to retrieve the video information for a YouTube video (I saw in some tutorial) basically here\'s the code

             


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-19 19:54

    function youtubeFeedCallback1(data) {
      var s = '';
      var k = '';
      s += data.entry.title.$t;
      k += data.entry.media$group.media$thumbnail[2].url;
      vidtitle1 = s
      vidthumb1 = k
    
    }
    
    
    
    
    

    I think you get the idea: 1. create empty script container. 2. define the complete link in a variable. 3. set this variable as a src attribute to the empty script.

    p.s. don't know if it works in js. This is jquery

提交回复
热议问题