This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//外部リンク自動判断スクリプト | |
onload = function () { | |
var CheckURL = document.links; | |
for(i=0;i<CheckURL.length;i++) { | |
var links = CheckURL[i].href.split('/'); | |
if((links[0].match(/[http|s]:/)) && (location.hostname != links[2])) { | |
CheckURL[i].target = '_blank'; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//文字切り替え | |
//StrCng('ID','切り替えたい文字'); | |
function StrCng(id,st){ | |
var cng1 = document.getElementById(id); | |
var cng2 = cng1.innerHTML; | |
cng1.onmouseover = function () { | |
cng1.innerHTML = st; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//画像切り替え | |
//ImgCng('画像ID','切り替えたい画像名'); | |
//例 : ImgCng('img','image/img2.jpg'); | |
function ImgCng(id,img){ | |
var cng1 = document.getElementById(id); | |
var cng2 = cng1.src; | |
cng1.onmouseover = function () { | |
cng1.src = img; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//$get = e($_GET['get']); | |
function e($str, $charset = 'UTF-8') { | |
return htmlspecialchars($str, ENT_QUOTES, $charset); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onload = function () { | |
var now = new Date(); | |
var y = now.getFullYear(); | |
var m = now.getMonth(); | |
document.write(y+'年'+m+'月<br>'); | |
for (i=1;i<=31;i++) { | |
var check = new Date(y, m, i); | |
if (check.getMonth() == m) { | |
var d = document.createTextNode(i); | |
document.body.appendChild(d); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//入力案内出力 | |
function GidFm (id, on, out) { | |
var check = ''; | |
var gf = document.getElementById(id); | |
var gfv = gf.value; | |
gf.style.color = out; | |
if (gf.type == 'password') { | |
gf.type = 'text'; | |
check = 'pass'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 0 = グー 1 = チョキ 2 = パー | |
function janken (me) { | |
//相手の手 | |
var you = Math.floor(Math.random () * 3); | |
$('me').innerHTML = hand(me); | |
$('you').innerHTML = hand(you); | |
$('res').innerHTML = result(me, you); | |
} | |
//IDの取得 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//IE非対応バージョンです。 | |
function feedin (id, speed) { | |
//フェードさせたいところのID | |
var feed = document.getElementById(id); | |
var filter = 0; | |
//最初にフィルターを0に設定 | |
feed.style.opacity = 0; | |
feed.style.MozOpacity = 0; | |
var timer = setInterval(function () { | |
//filter += 0.1 だとちゃんと計算されない |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//秒を時間に変換 | |
function oclock ($s) { | |
$h = 0; | |
$m = 0; | |
while ($s >= 60) { | |
if ($s >= 3600) { | |
$s -= 3600; | |
$h++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?$s=9500;$m=$s%3600;echo($s-$m)/3600,':'.floor($m/60).':'.$m%60; |
OlderNewer