0
아약스 요청의 응답을 기반으로 웹 페이지를 조작하고 싶습니다. 기본적으로 YouTube에서 페이지의 제목을 검색하고 첫 번째 YouTube를 검색합니다. 여기확장 프로그램에서 아약스 요청을 할 수 없습니다.
var search_input = $("#title").text();
var keyword= encodeURIComponent(search_input);
// Youtube API
var yt_url='http://gdata.youtube.com/feeds/api/videos?q='+keyword+'&format=5&max-results=1&v=2&alt=jsonc';
$.ajax
({
type: "GET",
url: yt_url,
dataType:"jsonp",
success: function(response)
{
console.log("succeded");
if(response.data.items)
{
$.each(response.data.items, function(i,data)
{
var video_id=data.id;
var video_title=data.title;
var video_viewCount=data.viewCount;
// IFRAME Embed for YouTube
var video_frame="<iframe src='http://www.youtube.com/embed/"+video_id+"' frameborder='0' type='text/html'></iframe>";
var final="<div>"+video_frame+"</div><div id='count'>"+video_viewCount+" Views</div>";
$("#videos").html(final); // Result
});
}
else
{
$("#videos").html("<div id='no'>No Video</div>");
}
}
});
그리고는 아약스 요청을하려고 할 때 확장이 Uncaught ReferenceError: jQuery11100021788313053548336_1393869626682 is not defined
을 던졌습니다
{
"content_scripts": [
{
"matches": [
"https://*.website.com/*",
"*://*.youtube.com/*"
],
"js": [
"jquery.js",
"mymanipulatır.js"
]
}
],
"name": "Name",
"icons": {
"128": "128x128.png"
},
"homepage_url": "http://github.com/",
"version": "1.4",
"manifest_version": 2,
"developer": {
"name": "may"
},
"description": "youtube"
}
의 manifest.json입니다. 내가 뭘 놓치고 있니?