Skip to content

Instantly share code, notes, and snippets.

Kouji Nakashima kuc-arc-f

Block or report user

Report or block kuc-arc-f

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View c0605-image-top-1.js
var xhr = new XMLHttpRequest();
xhr.open('GET', imageUrl);
xhr.responseType = 'blob';
xhr.onload = function() {
var img = document.createElement('img');
img.setAttribute('data-src', imageUrl);
img.setAttribute('id', s_id);
img.className = 'icon';
var objURL = this._createObjectURL(xhr.response);
img.setAttribute('src', objURL);
View c0605-image-top-2.js
AppShow.prototype.proc_init = function() {
console.log('#proc_init');
var s1='http://kuc-arc-f.github.io/h5_t0604_page/img/p1.png';
var s2='http://kuc-arc-f.github.io/h5_t0604_page/img/p2.JPG';
var s3='http://kuc-arc-f.github.io/h5_t0604_page/img/p3.JPG';
var ctl = new Controller();
var divcont = document.querySelector('div#id-div-img');
var img_t= ctl._requestRemoteImageAddElem( s1, divcont ,'id_img1');
View c0605-ajax1-top-1.js
ctlNews.prototype.load_rss = function( surl ) {
var items =new Array();
console.log( 'surl=' + surl );
$.ajax({
url: surl,
type: 'get',
dataType: 'xml',
timeout: 5000,
success: function(xml, status) {
if (status === 'success') {
View c0605-ajax1-top-2.js
function disp_news(items)
{
for(var i = 0; i < items.length ; i++){
var body= $('table#id-table1');
var trObj = $('<tr></tr>');
var tdObj = $('<td></td>');
var a_tag = $('<a href="'+ items[i].url +'" target="_blank">'+ items[i].title +'</a>');
var tdObj02 = $('<td align="right"></td>');
View c0530-sound-index-1.js
function init_item()
{
var items = new Array();
items[0] = {snd_name : 's1', snd_url : 'https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/36209861&amp;color=ff5500&amp;auto_play=true&amp;hide_related=false&amp;show_artwork=true' };
items[1] = {snd_name : 's2', snd_url : 'https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/36479386&amp;color=ff5500&amp;auto_play=true&amp;hide_related=false&amp;show_artwork=true' };
items[2] = {snd_name : 's3', snd_url : 'https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/36480994&amp;color=ff5500&amp;auto_play=true&amp;hide_related=false&amp;show_artwork=true' };
return items;
}
View c0530-sound-index-2.js
function load_sound( items )
{
if((items ==null) || (items.length < 1))
{
return;
}
var s_url = get_sound_id(items);
console.log('s_url=' + s_url );
var divSound= $('div#id-div-sound1');
View c0530-sound-index-3.htm
<iframe width="100%" height="450" scrolling="no" frameborder="no"
src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/36480994&amp;color=ff5500&amp;auto_play=true&amp;hide_related=false&amp;show_artwork=true">
</iframe>
View c0606-db1-top1.js
function init_proc()
{
if (window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB) {
console.log('OK: use indexedDB');
}else{
console.log('NG: use indexedDB');
}
var db= new DbHelper();
db.getInstance();
View c0606-db1-top2.js
DbHelper.prototype.getInstance = function( ) {
var db=null;
//open
var rq = indexedDB.open(DB_NAME);
rq.onupgradeneeded = function(result) {
console.log('#onupgradeneeded');
db = this.result;
var store = db.createObjectStore(STORE_NAME, {
View c0606-db1-top3.js
DbHelper.prototype.proc_addItem = function(item ,view)
{
var rq = indexedDB.open(DB_NAME);
rq.onsuccess = function(e) {
console.log('#onsuccess_open');
var db= e.target.result;
var tx = db.transaction(STORE_NAME, 'readwrite');
tx.oncomplete = function() { };
var store = tx.objectStore(STORE_NAME);
You can’t perform that action at this time.