<head>
<script>
function Homepage(){
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
//For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
DocURL = document.location.href;
//this is where the http or https will be, as found by searching for :// but skipping the res://
protocolIndex=DocURL.indexOf("://",4);
//this finds the ending slash for the domain server
serverIndex=DocURL.indexOf("/",protocolIndex + 3);
//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
//urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
BeginURL=DocURL.indexOf("#",1) + 1;
if (protocolIndex - BeginURL > 7)
urlresult=""
urlresult=DocURL.substring(BeginURL,serverIndex);
//for display, we need to skip after http://, and go to the next slash
displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
// Security precaution: must filter out "urlResult" and "displayresult"
forbiddenChars = new RegExp("[<>\'\"]", "g"); // Global search/replace
urlresult = urlresult.replace(forbiddenChars, "");
displayresult = displayresult.replace(forbiddenChars, "");
>ヘッダースクリプト
function OpenWindow(URL,Winname,Width)
{SubWindow=window.open(URL,Winname,"width=620,height=660,scrollbars=yes,toolbar=no,location=no,status=no,directories=no,resizable=yes,");
}
>本文
a href="javascript:OpenWindow('kiss.html','SubWindow');"
開いた画面を手前に出すバージョン↓
<script language="JavaScript"><!--
function openwin(message) {
w = window.open("", "msg2", "alwaysRaised=yes");
w.focus();
w.document.open();
w.document.write(message);
w.document.close();
}
// --></script>
<script language="VBScript">
<!--
Dim counter, txt, txt_len, timerID
Sub Window_onLoad()
txt = txtbox.innerHTML
txt_len = Len(txt)
counter = 1
timerID = Window.SetInterval("typewriter()", 100)
//後の数字が大きいほどスピードは遅い
End Sub
Sub typewriter()
Dim cur
If counter > txt_len Then
cur = ""
Window.ClearInterval(timerID)
Else
cur = "|"
End If
txtbox.innerHTML = Left(txt, counter) & cur
counter = counter + 1
End Sub
//-->
</script>