ページの読み込み時と東部標準時の午前 11 時から午後 7 時の間にのみ開くポップアップ ウィンドウを作成する必要があります。
自動ポップアップは機能していますが、時間分散の追加に問題があります。
お知らせ下さい。編集済み
<!--chat-->
<script type="text/javascript">
$(document).ready(function() {
var currentTime = new Date((new Date()).toUTCString());
var startTime = new Date((new Date()).toUTCString());
var endTime = new Date((new Date()).toUTCString());
startTime.setUTCHours(8);
endTime.setUTCHours(19);
//set times to EST. (UTC -5)
currentTime.setHours(currentTime.getHours() - 5);
startTime.setHours(startTime.getHours() - 5);
endTime.setHours(endTime.getHours() - 5);
//code to determine your variables goes here
var mylink = "https://mylink.com";
var windowname = "Chat Client";
if (currentTime < endTime && currentTime > startTime) {
popup(mylink, windowname);
}
});
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=470,height=700,scrollbars=yes');
return false;
}
</SCRIPT>