D

유트브영상 순간검색 구현

· 14년 전 · 2173 · 9
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="history" content="">
<meta name="author" content="dokjin@gamil.com">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<title>유트브 순간검색</title>
<script type="text/javascript">
$(document).ready(function()
{

$(".search_input").keyup(function()
{
var search_input = $(this).val();
var keyword= encodeURIComponent(search_input);
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)
{
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;
var video_frame="<iframe width='640' height='385' src='http://www.youtube.com/embed/"+video_id+"' frameborder='0' type='text/html'></iframe>";
var final="<div id='title'>"+video_title+"</div><div>"+video_frame+"</div><div id='count'>"+video_viewCount+" Views</div>";
$("#result").html(final); // Result
});
}
else
{
$("#result").html("<div id='no'>No Video</div>");
}
}
});
});
});
function yts(search_input){
var keyword= encodeURIComponent(search_input);
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)
{
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;
var video_frame="<iframe width='640' height='385' src='http://www.youtube.com/embed/"+video_id+"' frameborder='0' type='text/html'></iframe>";
var final="<div id='title'>"+video_title+"</div><div>"+video_frame+"</div><div id='count'>오늘까지뷰 "+video_viewCount+" Views</div>";
$("#result").html(final); // Result
});
}
else
{
$("#result").html("<div id='no'>No Video</div>");
}
}
});
}
yts('Empire State of Mind');
</script>
</head>
<body>
<div id="wrap">
<h2>DOKJIN PLAY GROUND</h2>
<div id="result"></div>
<h2>검색어를 입력하세요 <input type="text" class='search_input' /> </h2>
<br />
<h2><a href="#" onclick="yts('아이유');">onclick="yts('아이유');"</a></h2>
<ul>
</div>
</body>
</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>

첨부파일

youtube.html (2.7 KB) 86회 2011-07-13 13:31
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

태그 필터 (최대 3개) 전체 개발자 소스 기타 mysql 팁자료실 javascript php linux flash 정규표현식 jquery node.js mobile 웹서버 os 프로그램 강좌 썸네일 이미지관련 도로명주소 그누보드5 기획자 견적서 계약서 기획서 마케팅 제안서 seo 통계 서식 통계자료 퍼블리셔 html css 반응형 웹접근성 퍼블리싱 표준화 반응형웹 홈페이지기초 부트스트랩 angularjs 포럼 스크린리더 센스리더 개발자톡 개발자팁 퍼블리셔톡 퍼블리셔팁 기획자톡 기획자팁 프로그램강좌 퍼블리싱강좌
+
제목 글쓴이 날짜 조회
14년 전 조회 1,777
14년 전 조회 873
14년 전 조회 1,093
14년 전 조회 1,148
14년 전 조회 1,511
14년 전 조회 1,116
14년 전 조회 1,423
14년 전 조회 3,354
14년 전 조회 1,727
14년 전 조회 1,122
14년 전 조회 1,894
14년 전 조회 1,274
14년 전 조회 803
14년 전 조회 2,711
14년 전 조회 1,103
14년 전 조회 1,168
14년 전 조회 1,453
14년 전 조회 1,329
14년 전 조회 1,357
14년 전 조회 910
14년 전 조회 2,787
14년 전 조회 1,172
14년 전 조회 1,805
14년 전 조회 1,431
14년 전 조회 1,444
14년 전 조회 1,170
14년 전 조회 1,444
14년 전 조회 1,022
14년 전 조회 1,041
14년 전 조회 1,871
14년 전 조회 1,618
14년 전 조회 1,423
14년 전 조회 1,472
14년 전 조회 2,221
14년 전 조회 1,828
14년 전 조회 977
14년 전 조회 1,820
14년 전 조회 1,604
14년 전 조회 1,683
14년 전 조회 1,171
14년 전 조회 1,191
14년 전 조회 1,170
14년 전 조회 1,122
14년 전 조회 1,767
14년 전 조회 1,113
14년 전 조회 1,412
14년 전 조회 1,677
14년 전 조회 1,741
14년 전 조회 1,415
14년 전 조회 2,174
14년 전 조회 1,515
14년 전 조회 2,135
14년 전 조회 1,697
14년 전 조회 1,354
14년 전 조회 3,422
14년 전 조회 1,881
14년 전 조회 1,329
14년 전 조회 1,201
14년 전 조회 1,888
14년 전 조회 1,285
14년 전 조회 1,082
14년 전 조회 1,027
14년 전 조회 2,263
14년 전 조회 947
14년 전 조회 1,175
14년 전 조회 1,941
14년 전 조회 1,267
14년 전 조회 1,269
14년 전 조회 1,808
14년 전 조회 1,479
14년 전 조회 1,537
14년 전 조회 1,329
14년 전 조회 2,625
14년 전 조회 1,433
14년 전 조회 1,112
14년 전 조회 1,332
14년 전 조회 1,091
14년 전 조회 1,125
14년 전 조회 951
14년 전 조회 1,156
14년 전 조회 1,526
14년 전 조회 1,763
14년 전 조회 1,320
14년 전 조회 1,393
14년 전 조회 1,248
14년 전 조회 1,441
14년 전 조회 1,709
14년 전 조회 1,482
14년 전 조회 1,712
14년 전 조회 1,443
14년 전 조회 1,375
14년 전 조회 1,395
14년 전 조회 1,375
14년 전 조회 1,892
14년 전 조회 1,841
14년 전 조회 1,646
14년 전 조회 1,749
14년 전 조회 1,990
14년 전 조회 964
14년 전 조회 1,436