Javascript jQuery.com不接受输入
我目前正在使用jQuery.tubble()在后台显示YT视频,其中ID是使用YouTube数据API获取的。管状加载,但不加载视频,我要求它出于任何原因。以下是相关的JS:Javascript jQuery.com不接受输入,javascript,jquery,tubular,Javascript,Jquery,Tubular,我目前正在使用jQuery.tubble()在后台显示YT视频,其中ID是使用YouTube数据API获取的。管状加载,但不加载视频,我要求它出于任何原因。以下是相关的JS: var output; $(document).ready(function() { getURLPs(); //parses url params into an array, this works $('#content').hide().delay(7000).fadeIn('slow'); consol
var output;
$(document).ready(function() {
getURLPs(); //parses url params into an array, this works
$('#content').hide().delay(7000).fadeIn('slow');
console.log('ID: '+urlParams["id"]);
console.log('Title: '+urlParams["title"]);
tubularoptions = '{videoId: \''+urlParams["id"]+'\'}';
console.log('Passing \"'+tubularoptions+'\" to jQuery.tubular.');
$('#wrapper').tubular(tubularoptions);
output = '<span class=\"animlink\"><a href=\"http://www.youtube.com/watch?v='+urlParams["id"]+'\">'+urlParams["title"]+'</a></span>';
$('#nowplaying-text').append(output);
$('#preloader').delay(1000).fadeOut('slow',function(){$(this).remove();});
});
但随后将加载默认视频。一切看起来都应该正常,但实际上并非如此。有什么线索吗?您传递的是字符串而不是对象 这很有效
var output;
var urlParams = {id:'G15btlaZR_k', title:'Ryos ft. Allisa Rose - Eclipse'};
$(document).ready(function () {
$('#content').hide().delay(7000).fadeIn('slow');
$('#content').hide().delay(7000).fadeIn('slow');
console.log('ID: ' + urlParams["id"]);
console.log('Title: ' + urlParams["title"]);
tubularoptions = '{videoId: \'' + urlParams["id"] + '\'}';
console.log('Passing \"' + tubularoptions + '\" to jQuery.tubular.');
//*************************************************
$('#wrapper').tubular({videoId: urlParams["id"] });
//*************************************************
output = '<span class=\"animlink\"><a href=\"http://www.youtube.com/watch?v=' + urlParams["id"] + '\">' + urlParams["title"] + '</a></span>';
$('#nowplaying-text').append(output);
$('#preloader').delay(1000).fadeOut('slow', function () { $(this).remove(); });
});
var输出;
var urlParams={id:'G15btlaZR_k',标题:'Ryos ft.Allisa Rose-Eclipse';
$(文档).ready(函数(){
$('#content').hide().delay(7000.fadeIn('slow');
$('#content').hide().delay(7000.fadeIn('slow');
log('ID:'+urlparms[“ID”]);
log('Title:'+urlparms[“Title”]);
tubularoptions='{videoId:\''+urlParams[“id”]+'\'}';
log('Passing\''+tubularoptions+'\'到jQuery.tubullel');
//*************************************************
$('#wrapper')。管状({videoId:urlparms[“id”]});
//*************************************************
输出='';
$(“#正在播放文本”).append(输出);
$('#preload').delay(1000).fadeOut('slow',function(){$(this.remove();});
});
这也一样
var output;
var urlParams = {id:'G15btlaZR_k', title:'Ryos ft. Allisa Rose - Eclipse'};
$(document).ready(function () {
$('#content').hide().delay(7000).fadeIn('slow');
$('#content').hide().delay(7000).fadeIn('slow');
console.log('ID: ' + urlParams["id"]);
console.log('Title: ' + urlParams["title"]);
//*************************************************
var tubularoptions = { videoId: urlParams["id"] };
//*************************************************
console.log('Passing \"' + tubularoptions + '\" to jQuery.tubular.');
$('#wrapper').tubular(tubularoptions);
output = '<span class=\"animlink\"><a href=\"http://www.youtube.com/watch?v=' + urlParams["id"] + '\">' + urlParams["title"] + '</a></span>';
$('#nowplaying-text').append(output);
$('#preloader').delay(1000).fadeOut('slow', function () { $(this).remove(); });
});
var输出;
var urlParams={id:'G15btlaZR_k',标题:'Ryos ft.Allisa Rose-Eclipse';
$(文档).ready(函数(){
$('#content').hide().delay(7000.fadeIn('slow');
$('#content').hide().delay(7000.fadeIn('slow');
log('ID:'+urlparms[“ID”]);
log('Title:'+urlparms[“Title”]);
//*************************************************
var tubularoptions={videoId:urlParams[“id”]};
//*************************************************
log('Passing\''+tubularoptions+'\'到jQuery.tubullel');
$(“#包装”)。管状(管状选项);
输出='';
$(“#正在播放文本”).append(输出);
$('#preload').delay(1000).fadeOut('slow',function(){$(this.remove();});
});
var output;
var urlParams = {id:'G15btlaZR_k', title:'Ryos ft. Allisa Rose - Eclipse'};
$(document).ready(function () {
$('#content').hide().delay(7000).fadeIn('slow');
$('#content').hide().delay(7000).fadeIn('slow');
console.log('ID: ' + urlParams["id"]);
console.log('Title: ' + urlParams["title"]);
//*************************************************
var tubularoptions = { videoId: urlParams["id"] };
//*************************************************
console.log('Passing \"' + tubularoptions + '\" to jQuery.tubular.');
$('#wrapper').tubular(tubularoptions);
output = '<span class=\"animlink\"><a href=\"http://www.youtube.com/watch?v=' + urlParams["id"] + '\">' + urlParams["title"] + '</a></span>';
$('#nowplaying-text').append(output);
$('#preloader').delay(1000).fadeOut('slow', function () { $(this).remove(); });
});