Skip to content

Instantly share code, notes, and snippets.

View suneo3476's full-sized avatar

suneo3476 suneo3476

  • Hamamatsu, Shizuoka, Japan
View GitHub Profile
#include<stdio.h>
void main(int argc[], char *argv[]){
printf("Hello World!\n");
return;
}
#include<stdio.h>
void main(int argc[], char *argv[]){
printf("Hello World!\n");
return;
}
@suneo3476
suneo3476 / html_dic.txt
Created April 25, 2013 19:40
Google日本語入力用のHTMLタグ辞書のエクスポートデータです。 This is the exported data of HTML tag dictionary for Google Japnaese IME.
へてむる <html></html> 記号
へっど <head></head> 記号
ぼでぃ <body></body> 記号
みだし <h1></h1> 記号
みだし <h2></h2> 記号
みだし <h3></h3> 記号
みだし <h4></h4> 記号
みだし <h5></h5> 記号
みだし <h6></h6> 記号
だんらく <p></p> 記号
@suneo3476
suneo3476 / style_change.html
Last active December 18, 2015 14:29
【解決】「パーフェクトJavaScript」p.286 リスト11.5 のコード。 チェックボックスによって適用するcssを変更する。 Firefox4.* でチェックボックスのイベントが起こる度に、 TypeError: document.getElementById(...) is null [Break On This Error] document.getElementById(id).disabled = !enable; とのこと。どなたかわかる方いらっしゃいませんか。
<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>スタイルシートそのものを変更する</title>
<style>
<link rel="stylesheet" type="text/css" href="style-a.css" id="style-a" disabled="true">
<link rel="stylesheet" type="text/css" href="style-b.css" id="style-b" disabled="true">
#foo {
background-color: #999;
@suneo3476
suneo3476 / move_element_by_click.html
Last active December 18, 2015 14:39
【未解決】「パーフェクトJavaScript」p.288 リスト11.7 のコード。クリックした座標にdiv要素を移動させたい。しかしできない。取り出したmessageオブジェクトのtop, left属性は空… 何か間違えている?
<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>クリックした位置に要素を表示する</title>
</head>
<body>
<div id="foo" style="width: 2000px; height: 2000px; position: relative;">
<div id="message" style="position: absolute; background: lightgray; width: 100px;">Hello, World!</div>
</div>
@suneo3476
suneo3476 / animetion.html
Created June 17, 2013 18:10
要素がsetIntervalでアニメーションする。
<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>アニメーション</title>
</head>
<body>
<div id="foo" style="position: absolute">This is sample.</div>
<script>
var elem = document.getElementById('foo');
@suneo3476
suneo3476 / xmlHttpRequest_with_x_browser.html
Last active December 18, 2015 14:39
IE6以前とクロスブラウザを実現するXMLHttpRequestのコード。ページに表面的な挙動はない。 (IE6なんて入れるのめんどいし確認などしてない)
<!DOCTYPE HTML5>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>This is test for XMLHttpRequest with X-Browser. The page does not have any function.</div>
<script>
if(!window.XMLHttpRequest) {
// Internet Explorer 6
@suneo3476
suneo3476 / xmlHttpRequest.html
Last active December 18, 2015 14:39
【未解決】XMLHttpRequestのサンプル。いまいち成功しているかどうかが分からない。少なくともalertは出ないし…
<!DOCTYPE HTML5>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>This is test for XMLHttpRequest.</div>
<script>
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://suneo3476.net');
@suneo3476
suneo3476 / xmlHttpRequest_sync_connection.html
Created June 17, 2013 19:01
【未解決】同期通信のXMLHttpRequest。 Firefoxだと「NS_ERROR_FAILURE: Failure」 Chromeだと「Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101 」 かと言って同期通信するケースって殆ど無いし、ユーザビリティ下げるしなぁ。 解決方法知っとくべきなのかなぁ。誰か知ってたら教えて。
<!DOCTYPE HTML5>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>This is test for XMLHttpRequest.</div>
<script>
var xhr = XMLHttpRequest();
xhr.open('GET', 'http://suneo3476.net', false); // 第三引数にfalseを指定して同期通信する
@suneo3476
suneo3476 / xmlHttpRequest_timeout.js
Last active December 18, 2015 15:19
【未実行】「パーフェクトJavaScript」p.294 リスト11.12 XMLHttpRequestのタイムアウト処理。テストしてない。
<script>
var xhr = new XMLHttpRequest();
var timerId = window.setTimeout(function() {
xhr.abort();
}, 5000); // 5秒
xhr.onreadystatechange = function() {
if (request.readyState == 4) {
// タイムアウト処理をキャンセルする
window.clearTimeout(timerId);
}