/*
* newWindow
*
* @parm
* @return
* @other
* ボタンクリック時に呼び出される関数
*
*/
function newWindow()
{
//変数宣言
var windowUrl;
var windowWidth;
var windowheight;
//データ取得
windowUrl = document.getElementById('url').value; // 入力されたURL
windowWidth = document.getElementById('wid').value; // 入力されたウインドウ幅
windowheight = document.getElementById('hei').value; // 入力されたウインドウ高さ
if(windowUrl == "")
{
// urlがなければ開くページがいないので、処理を実行せず、アラートを表示させて処理の終了
alert('urlを指定してください。');
}
else
{
// urlの指定がある場合
// 他値の存在確認、指定なければ初期値を設定する。
// 値投入時でもいいのだが urlのがない場合は無駄な処理となるので
// 必要な時に必要な処理を行うようにするためここで判別する
if(windowWidth == "")
{
windowWidth = 600;
}
if(windowheight == "")
{
windowheight = 600;
}
// 別ウインドウにて開く
window.open(windowUrl,'','width='+windowWidth+', height='+windowheight);
}
© Company 2012