PHP & JavaScript Room :: 設置サンプル

実行結果

ウィンドウを開く(ウィンドウ内に表示するHTML指定)

ソース

<script type="text/javascript">
    function fCreateOpen(htmlStr){
        var win=window.open("","win","top=0,width=300,height=200,left=0,location=1,status=1");
        win.document.open();
        win.document.write(htmlStr);
        win.document.close();
        win.focus();
    }
</script>

<a href="javascript:fCreateOpen('<html><head><meta http-equiv=\'content-type\' content=\'text/html; charset=utf-8\'><title>サンプル</title></head><bo'+'dy style=\'background-color:#ffff88; text-align:center; font-size:small;\'><strong>サンプルテキスト</strong><p><img src=\'/content/img/dog_white.gif\' alt=\'Dog\'></p><p><a href=\'javascript:self.close();\'>ウィンドウを閉じる</a></p></bo'+'dy></html>');">ウィンドウを開く(ウィンドウ内に表示するHTML指定)</a>

polarized women