スキップしてメイン コンテンツに移動

投稿

ラベル(JSONP)が付いた投稿を表示しています

JSONP + Push State: Youtube Application Example

Improve Performance for MySQL CALC_FOUND_ROWS with LIMIT OFFSET Push State Push state is html5 technology that records browsing history in javascript without actual page refresh. Push state is useful for recording Ajax request, which cannot record the browsing history normally, and telling the corresponding url for the Ajax request to browser. The minimum push state code is below: // push the browser state if (typeof(history.replaceState) !== "undefined") { history.pushState({prop1: "a", prop2:"b"}, null, "/url/?param1=param"); } // when browser back button is pressed, pop state event is fired // pop state handler is registered in the folloing code window.onpopstate = function (event) { if (event.state == null) { return; } // do something nice ;) // using "event.state.prop1" for example }; The usage of push state is quite simple. One thing you should remember is that when pop state event is fired, the browse

Get Youtube Video Detail Information Only Using Javascript

Demo URL Title Duration (Sec) View Count Source code <table border="1"> <tbody> <tr> <td>URL</td> <td><input type="text" id="youtubeVideo_url" style="width:100%"></td> </tr> <tr> <td>Title</td> <td><div id="youtubeVideo_title"></div></td> </tr> <tr> <td>Duration (Sec)</td> <td><div id="youtubeVideo_duration_seconds"></div></td> </tr> <tr> <td>View Count</td> <td><div id="youtubeVideo_view_count"></div></td> </tr> </tbody> </table> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript"> $("#youtubeVideo_url").keyup(function(e){ delay(function(){ var url = $('#yout