ホーム へ サンプルページ メッセージ25 message25.htm
日付・時刻表示、ランダムリンク(50%)、乱数表示(0〜99)。 VBScript - "select case" statement、Date and Time Functions、Random link、Other Built-in Functions - Return a random number between 0-99。 ハイパーリンクなどのカスタマイズはテキストエディターなどで可。 all 対応。 コピー、編集し、簡単にWebで応用できまっ、(^ ^)。
デモは、
のマウスオーバーや、F5キーでの再読込で。
< ご使用方法 >
・ ローカル(=PC)への保存は、message25.htm を右クリック、[対象をファイルに保存] - 【ファイルのダウンロード】、【ファイル名を付けて保存】 - <保存する場所>: ……、などで。 ※: 【Internet Explorer】 - [ファイル] - [名前を付けて保存]−[ファイルの種類] ”Webページ、完全” ……、などで変わってしまったファイル名や、*.html 中のパスは要修正。
・ このVBScriptの実装方法は、message25.htm をテキストエディターで開き、ホームページ作成ソフトなどのHTML挿入/編集メニューなどを使って、新しいページ
1 や hogehoge.html(=任意の挿入先ファイル名) の、 <head> 〜 </head> の任意の行間に (*1)
を、さらに <body> 〜 </body>の任意の行間に (*2) をペーストします。
・ 関連情報 :
色記号、2、スタイルシートリファレンス、ホームページ開設入門
が便利!。 Web
& Internet Samples、Online
Columns、XML、DHTMLとは?、ColorTable、HTMLの色指定、色見本。
(*1)
: message25.htm (例) 挿入先の <head> 〜 </head> の、〜 部分にペーストします。
|
HTMLの編集方法 |
(*1) をテキストエディターで開き、下記↓のHTMLを挿入先ファイルにペースト、太字部分を編集し使用。 |
|
〔この列ペースト不要〕
シフトJIS使用(削除不可)
ieなどに表示するアイコンファイル名(削除可)
<style type 〜 </style>は(削除可)
マウスオーバー時のテキスト
背景色 下線非表示
非マウスオーバー時の下線表示(逆も可)
リンクを新しいWinで開くを標準(削除可)※:target= いろいろ
同じフレーム target="_self"
ページ全体 target="_top"
親フレーム target="_parent"
お気に入り、タスクバーに表示するページ名(≠ファイル名)
|
<meta http-equiv="Content-Type" content="text/html; charset=x-sjis">
<link REL="SHORTCUT ICON" href="favicon.ico">
<style type="text/css"><!--
A:hover {
COLOR: #8000e2;
BACKGROUND-COLOR: #f3edee; TEXT-DECORATION: none
}
A {
TEXT-DECORATION: underline
}
-->
</style>
<base target="_blank">
<title>サンプルページ メッセージ 25</title>
|
(*2)
: message25.htm (例) 挿入先の <body> 〜
</body> の、〜
部分にペーストします。
|
HTMLの編集方法 |
(*2)をテキストエディターで開き、下記↓のHTMLを挿入先ファイルにペースト、太字部分を編集し使用。 |
|
〔この列ペースト不要〕
※:<body> 部の編集 背景 リンク 表示済みリンク アクティブリンクの各色(任意値)
今日は、*曜日
今日は(yyyy/mm/dd)
時刻は(hh/mm/ss)
ランダムハイパーリンク サイト名
乱数 0〜99
|
<body bgcolor="#F8F5F5" link="#54006C" vlink="#62000D" alink="#00FFFF">
<!-- ☆ 1 ----------- ↓ この間をコピー&ペーストします。
------------ -->
<!--webbot bot="HTMLMarkup" startspan -->
<!-- ■ ---- 位置調整のためのDIV有りは、 ↓ この間をコピー&ペーストします。 -->
<!-- 表示枠位置 表示枠サイズ 座標 表示枠背景色 -->
<div style="position:absolute; top:10; left:10; width:200;
height:0; z-index:0; visibility:visible; background-color:#FFFFFF;
background-image: url(''); cursor:hand;" title="Conditional
Statements、”select case” statement">
<table width="200" height="" border="1" cellspacing="0"
cellpadding="2" bgcolor="#FFFFFF" style="border-collapse: collapse"
bordercolorlight="#F1F0FB" bordercolordark="#D5CED3">
<tr>
<td bgcolor="#FFFFFF" valign="top" align="left" background="http://xml-xsl.sakura.ne.jp/wttec.gif">
<!-- ★ ----------- ↓ この間をコピー&ペーストします。 ------------ -->
<script type="text/vbscript">
d=weekday(date)
select case d
case 1
document.write("今日は、日曜日")
case 2
document.write("今日は、月曜日")
case 3
document.write("今日は、火曜日")
case 4
document.write("今日は、水曜日")
case 5
document.write("今日は、木曜日")
case 6
document.write("今日は、金曜日")
case else
document.write("今日は、土曜日")
end select
</script>
=(゜。.゜)= 〜*
<!-- ★ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
</td>
</tr>
</table>
</DIV>
<!-- ■ ---- 位置調整のためのDIV有りは ↑ この間をコピー&ペーストします。 -->
<!--webbot bot="HTMLMarkup" endspan -->
<!-- ☆ 1 ----------- ↑ この間をコピー&ペーストします。 ------------ -->
<!-- ☆ 2 ----------- ↓ この間をコピー&ペーストします。 ------------ -->
<!--webbot bot="HTMLMarkup" startspan -->
<!-- ■ ---- 位置調整のためのDIV有りは、 ↓ この間をコピー&ペーストします。 -->
<!-- 表示枠位置 表示枠サイズ 座標 表示枠背景色 -->
<div style="position:absolute; top:10; left:230; width:220;
height:0; z-index:0; visibility:visible; background-color:#FFFFFF;
background-image: url(''); cursor:hand;" title="Date and Time Functions">
<table width="220" height="" border="1" cellspacing="0"
cellpadding="2" bgcolor="#FFFFFF" style="border-collapse: collapse"
bordercolorlight="#F1F0FB" bordercolordark="#D5CED3">
<tr>
<td bgcolor="#FFFFFF" valign="top" align="left" background="http://xml-xsl.sakura.ne.jp/wttec.gif">
<!-- ★ ----------- ↓ この間をコピー&ペーストします。 ------------ -->
<script type="text/vbscript">
document.write("今日は(yyyy/mm/dd): " & date())
document.write("<br />")
document.write("時刻は(hh/mm/ss): " & time())
</script>
<!-- ★ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
</td>
</tr>
</table>
</DIV>
<!-- ■ ---- 位置調整のためのDIV有りは ↑ この間をコピー&ペーストします。 -->
<!--webbot bot="HTMLMarkup" endspan -->
<!-- ☆ 2 ----------- ↑ この間をコピー&ペーストします。 ------------ -->
<!-- ☆ 3 ----------- ↓ この間をコピー&ペーストします。 ------------ -->
<!--webbot bot="HTMLMarkup" startspan -->
<!-- ■ ---- 位置調整のためのDIV有りは、 ↓ この間をコピー&ペーストします。 -->
<!-- 表示枠位置 表示枠サイズ 座標 表示枠背景色 -->
<div style="position:absolute; top:40; left:10; width:100;
height:0; z-index:0; visibility:visible; background-color:#FFFFFF;
background-image: url('');" title="Conditional Statements、Random link">
<table width="100" height="" border="1" cellspacing="0"
cellpadding="2" bgcolor="#FFFFFF" style="border-collapse: collapse"
bordercolorlight="#F1F0FB" bordercolordark="#D5CED3">
<tr>
<td bgcolor="#FFFFFF" valign="top" align="left" background="http://xml-xsl.sakura.ne.jp/wttec.gif">
<!-- ★ ----------- ↓ この間をコピー&ペーストします。 ------------ -->
<script type="text/vbscript">
randomize()
r=rnd()
if r>0.5 then
document.write("<a href='http://www.google.co.jp/'>Google日本</a>")
else
document.write("<a href='http://www.pat.hi-ho.ne.jp/oka_tosho/search_google4.htm'>サイト内検索</a>")
end if
</script>
<!-- ★ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
</td>
</tr>
</table>
</DIV>
<!-- ■ ---- 位置調整のためのDIV有りは ↑ この間をコピー&ペーストします。 -->
<!--webbot bot="HTMLMarkup" endspan -->
<!-- ☆ 3 ----------- ↑ この間をコピー&ペーストします。 ------------ -->
<!-- ☆ 4 ----------- ↓ この間をコピー&ペーストします。 ------------ -->
<!--webbot bot="HTMLMarkup" startspan -->
<!-- ■ ---- 位置調整のためのDIV有りは、 ↓ この間をコピー&ペーストします。 -->
<!-- 表示枠位置 表示枠サイズ 座標 表示枠背景色 -->
<div style="position:absolute; top:70; left:10; width:120;
height:0; z-index:0; visibility:visible; background-color:#FFFFFF;
background-image: url(''); cursor:hand;" title="Return a random number
between 0〜99">
<table width="120" height="" border="1" cellspacing="0" cellpadding="2"
bgcolor="#FFFFFF" style="border-collapse: collapse"
bordercolorlight="#F1F0FB" bordercolordark="#D5CED3">
<tr>
<td bgcolor="#FFFFFF" valign="top" align="left" background="http://xml-xsl.sakura.ne.jp/wttec.gif">
<!-- ★ ----------- ↓ この間をコピー&ペーストします。 ------------ -->
<script type="text/vbscript">
randomize()
randomNumber=Int(100 * rnd())
document.write("乱数=0〜99 : <b>" & randomNumber & "</b>")
</script>
<!-- ★ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
</td>
</tr>
</table>
</DIV>
<!-- ■ ---- 位置調整のためのDIV有りは ↑ この間をコピー&ペーストします。 -->
<!--webbot bot="HTMLMarkup" endspan -->
<!-- ☆ 4 ----------- ↑ この間をコピー&ペーストします。 ------------ -->
|
< 補足 > 適時参照あれ!。
・ Wordpad によるHTMLソース(タグ)を見ながらの直接編集方法。