Skip to content

Instantly share code, notes, and snippets.

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);
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');
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') {
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>');
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;
}
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');
<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>
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();
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, {
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);