新しい投稿のフォーラムに通知するためにHTAを作成しました
次のコードをローカルにコピーし、HTAとして保存し、ダブルクリックして実行します。新しい投稿が右下隅に表示され、通知されます。通知ウィンドウは、10秒後に自動的に閉じられます。
コードは次のとおりです。
<html>
<head>
<title> blueideaboardwatcher-byhutia </title>
<! - プログラム設定。プログラムをタスクバーに表示したい場合は、showitaskbarをyesに変更してください - >
<hta:applicationId = "app1" singleinstance = "yes" contextmenu = "yes"
sysmenu = "yes" windowstate = "remary" maximizebutton = "no" minimizebutton = "yes"
ApplicationName = "BlueIdeaboardWatcher" version = "1.0" innerborder = "no"
キャプション= "yes" showitaskbar = "no" border = "thin"/>
<! - 言語GB2312->
<metahttp-equiv = "content-type" content = "text/html; charset =" gb2312 ">
<! - スタイルシート - >
<style>
ボディ、TD {
マージン:0px;
パディング:5px;
オーバーフロー:自動;
フォントサイズ:12px;
}
H3 {
フォントサイズ:14px;
}
iframe {
表示:なし;
}
</style>
<スクリプト>
// ******グローバル変数領域******
//クラシックフォーラム> DreamWeaver&JavaScript列
url = "http://bbs.blueidea.com/forumdisplay.php?fid=1";
//間隔10秒を更新します
間隔= 10000;
//コンポーネントを初期化します
試す{
varxmlhttp = newActiveXObject( "microsoft.xmlhttp");
varadodbstream = newactivexobject( "adod"+"b.st"+"ream");
} catch(e){
document.write( "<h3>ロードに失敗し、コンポーネントが無効になっている</h3>");
}
thisdomain = location.href.substring(0、location.href.lastindexof( "//"));
//次回との比較のためにREEでの最後の訪問の結果を保存します
ree = newArray();
//初期化が完了したかどうかを判断するために使用される変数
開始= false;
//開いたウィンドウの配列を保存します
thewin = newArray();
//関数を初期化します
functionIt(){
startcheck();
}
// get requestを送信します
functionStartCheck(){
xmlhttp.open( "get"、url、true);
xmlhttp.send();
xmlhttp.onreadystatechange = checkState;
}
// xmlhttpによって返された結果を確認します
functionCheckState(){
if(xmlhttp.readystate == 4){
if(xmlhttp.status == 200){
//返品値を取得するにはデコード
varstrhtml = b2s(xmlhttp.responsebody);
varistart = strhtml.search(/<tablecellpacing = 0cellpadding = 0width = "99%" border = 0>/i);