• 締切済み

新規ウインドウ+submit

はじめまして。 画像をクリックし、新規ウインドウ SUBMITさせたいのですが、 元のウインドウがクリックした画像のみの表示に切り替わってしまいます。 これを直したいのですがどうしたら良いでしょうか? 知恵を貸してください。 宜しくおねがします。 以下にその部分ソースを記述します。 function onSearchfree(val){ var coWinaddCookie; if (val==-1){ if (navigator.appName=="Microsoft Internet Explorer"){ coWinaddCookie=window.open("http://www.ooooo.co.jp","childaddCookie","status=yes,scrollbars=yes,width=800,height=600,left=0,top=0");} else{ // Netscape coWinaddCookie=window.open("http://www.ooooo.co.jp","childaddCookie","status=yes,scrollbars=yes,alwaysRaised=yes,width=800,height=600,screenX=0,screenY=0"); } coWinaddCookie.focus(); }else{ document.searchform.submit(); } } /*****HTML******/ <IMG src="http://www.ooooo.co.jp/image/set.gif" border="0" onmousedown="onSearchfree(-1)" title="" alt="">

みんなの回答

  • xruz
  • ベストアンサー率50% (72/143)
回答No.1

はじめましてharuka17さん、xruzです。 上記Scriptを(Ie5.5,NN4.75で)テストしてみましたが >元のウインドウがクリックした画像のみの表示に切り替わってしまいます。 といった現象は発生しませんでした。 <IMG>タグが<a>タグ内に有ったりしていませんでしょうか?

haruka17
質問者

お礼

御礼が遅くなってごめんなさい。 質問に説明不足があったともいます。 他の方法で何とか解決(妥協?)しました。 アドバイスありがとうございます。

関連するQ&A

  • JavaScriptでポップアップを中央に。

    最近JavaScriptを始めた者です。 ポップアップをアドレスバーとステータスバーを非表示にした状態で中央に表示させたいのですが、以下のコードでは、リンクをクリックしても反応がありません。 function openWinCenter(url,id,w,h,scrollFlag) { x = (screen.width - w) / 2; y = (screen.height - h) / 2; if(scrollFlag){ if(navigator.appName== "Microsoft Internet Explorer"){ w=w+16; } window.open(url,id,"screenX="+x+",screenY="+y+",left="+x+",top="+y+",width"+w+",height="+h+",scrollbars=yes,location=no,status=no"); }else{ window.open(url,id,"screenX="+x+",screenY="+y+",left="+x+",top="+y+",width="+w+",height="+h+",scrollbars=no,location=no,status=no"); } } どこを修正したらいいのか教えてください、よろしくお願いします。

  • ブラウザサイズをフルサイズで表示させる方法

    ブラウザにタイトルバーとスクロールバーとスタートバー以外を表示しないページを作成したいのですが、 XPはOKで、WIN98でうまくいきませんでした。リンク先をクリックすると別ウィンドウが立ち上がる仕組みです。画面サイズに合わせて変わるようなのですが、WIN98では、スクロールバーが途中で切れてしまい、 一番下まで、綺麗に表示できませんでした。これ以外の方法でもかまいませんので、どなたかご伝授いただければと思います。 function wopen(url){ if(screen.width <= 640){ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=640,height=480,left=0,top=0") }elseif(screen.width <= 800){ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=800,height=600,left=0,top=0") }else if(screen.width <= 1024){ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=1024,height=768,left=0,top=0") }else if(screen.width <= 1152){ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=1152,height=864,left=0,top=0") }else if(screen.width <= 1280){ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=1280,height=1024,left=0,top=0") }else{ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=1600,height=1240,left=0,top=0") } return; } : <A href="javascript:wopen('/index.html')">

  • リンク先の別ウインドウをスクロールバー付きの小窓にしたい

    HP製作中です。リンク先を小さめサイズの別ウインドウで開き、縦横にスクロールバーをつけたいのですが、 window.open(url, '_blank','width=600,height=600,left=100,top=10,screenX=100,screenY=10,scrollbars=yes'); と、数字は適当に入れて試してみましたがエラーになるのです。 どこがいけないのでしょうか? ちなみにホームページビルダーにて製作しております。

  • 別ウィンドウをそれぞれ違うサイズで位置指定で開きたい

    現在ウェブサイトを作っておりまして、別ウィンドウをそれぞれ違うサイズで位置指定で開きたいと思い、headの中に以下の記述をしました。 <SCRIPT language="JavaScript"> <!-- w = 800; h = 600; function season2009ss() { x = (screen.width - w) / 2; y = (screen.height - h) / 2; subWin = window.open("look/season2009ss.html","season2009ss","screenX="+x+",screenY="+y+",left="+x+",top="+y+",width="+w+",height="+h+",scrollbars=yes"); } //--> </SCRIPT> <SCRIPT language="JavaScript"> <!-- w = 500; h = 660; function contact() { x = (screen.width - w) / 2; y = (screen.height - h) / 2; subWin = window.open("mail/contact.html","contact","screenX="+x+",screenY="+y+",left="+x+",top="+y+",width="+w+",height="+h+",scrollbars=yes"); } //--> </SCRIPT> 開きたい画面は二つあり、位置は両ウィンドウとも画面の真ん中で、サイズのみ違います。 しかし、この形ですとなぜかウィンドウサイズは両方とも同じになってしまい、狙い通りにいきません。 何が原因なのでしょうか。

  • ポップアップウィンドウを画面中央に配置+複数リンクを同じウインドウに表示させたい

    過去にあった複数のイベント等の写真をスライドショーで紹介するページを作成中です。 ひとつのページ上に複数リンクがあって、それぞれクリックするとポップアプウィンドウが画面中央で開くようにすることはできました。(下記参照) <script type="text/javascript"> <!-- function win(url,windowname,width,height) { var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no"; if (width) { if (window.screen.width > width) features+=", left="+(window.screen.width-width)/2; else width=window.screen.width; features+=", width="+width; } if (height) { if (window.screen.height > height) features+=", top="+(window.screen.height-height)/2; else height=window.screen.height; features+=", height="+height; } window.open(url,windowname,features); } // --></script> body内 <a href="link_page.htm"onclick="win(this.href,null,600,430); return false;"><img src="image.gif" width="123" height="18" /></a></td> ただ複数あるリンクをクリックすると、ポップアップウィンドウも次々増えてしまうのを、常にひとつのウインドウ上に表示させることができません。 どうぞご指南よろしくお願いします!

  • 中央に小窓表示

    とあるサイトで中央に小窓表示JavaScriptを使用し Another HTML-lint gatewayで文法チェックしたら XHTMLでは <SCRIPT> や <STYLE> の内容が #PCDATA です。コメントはコメントとして解釈されてしまうので、旧来のテクニックは使えません。外部にスクリプトファイルやスタイルファイルを用意するようにしましょう。 とでました 下記のJavaScriptを外部形式にするにはxxx.jsに書くところまではわかりましたが書き方がわかりませんどこを変更したらいいのでしょうか <script type="text/javascript"><!-- function m_win(url,windowname,width,height) { var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no"; if (width) { if (window.screen.width > width) features+=", left="+(window.screen.width-width)/2; else width=window.screen.width; features+=", width="+width; } if (height) { if (window.screen.height > height) features+=", top="+(window.screen.height-height)/2; else height=window.screen.height; features+=", height="+height; } window.open(url,windowname,features); } // --></script> よろしくお願いします

  • 画像の小窓表示について

    サムネイルの画像をクリックすると画像の小窓が表示されるようにしたのですが縦長の画像と横長の画像が有るため縦長の画像の右側に余白が出てしまい見栄えが良くありません。画像の周りの白い淵をなくしたいのですが下記のタグをどのように修正すれば良いのでしょうか。 ご指導の程よろしくお願いします。早々 <SCRIPT language="JavaScript"> <!--HPB_SCRIPT_CODE_40 function _HpbJumpURLinNewWindow(url) { if (url != '') { window.open(url, '_blank','width=500,height=400,left=600,top=50,screenX=600,screenY50,scrollbars=yes'); } } //--> </SCRIPT></HEAD>

  • ジャバスクリプトでウィンドウサイズ指定を複数

    ご覧いただきありがとうございます。 ネットで調べながら独学でジャバスクリプトの設置をしております。 色々ためしたのですが解決できないのでご教授願います。 ウィンドウサイズを指定して新しいウィンドウを開くジャバスクリプトのリンクを、異なる条件で同じページに複数指定することはできるでしょうか。 同ページ内にあるAのリンクはサイズ400×300で、Bのリンクは600×500といった具合にです。 自分なりに考えてみて下記のように記述してみましたが、BのリンクにもAが適用されてしまいました。 ■head内の記述 <head> <script language="JavaScript"> <!-- function wopen1(){ win=window.open("リンクAのURL","new","width=400,height=300","resizable=no","scrollbars=no","menubar=no","toolbar=no","directories=no","status=no","left=100","top=100","screenX=100","screenY=100"); win.moveTo(100,100); } // --> </script> <script language="JavaScript"> <!-- function wopen2(){ win=window.open("リンクBのURL","new","width=600,height=500","resizable=yes","scrollbars=yes","menubar=no","toolbar=no","directories=no","status=no","left=100","top=100","screenX=100","screenY=100"); win.moveTo(100,100); } // --> </script> </head> ■リンク箇所の記述 <a href="javascript:wopen1()">リンクAのテキスト</a> <a href="javascript:wopen2()">リンクBのテキスト</a> head内の記述をひとつだけにすると正常に動作するので、head内の記述が間違っていると思うのですが、よくわかりません。ご教授おねがいいたします。

  • javascriptで別ウインドウを開いたのですが背景設置が上手くいきません。

    いつもお世話になっております。 JavaScriptを使用し別ウインドウで画像を表示させているのですが、 そのウインドウの背景が上手く設定できません。 どのように編集すればよいでしょうか? 現在の状態は以下の通りです。 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <title>aaa</title> <script language="javascript"> <!-- function OpenWindow(){ var width = document.images['00'].width + 228; var height = document.images['00'].height +254; subWin = window.open("","subWin","status=no,menubar=no,toolbar=no,scrollbars=no,resizable=yes,screenX=0,screenY=0,width=" + width + ",height=" + height + '"'); with(subWin.document) { open(); write("<html><head><title>sample1</title></head>"); write("<body onload='window.resizeTo( document.images[00].width + 40,document.images[00].height + 120)'><div align='center'><img id='00' src='b/1b.jpg'><br>"); write("<button type='button' onclick='window.close()'>閉じる</button></body></div></html>"); close(); } } --> </script></head> 宜しくお願いします。

  • Chromでポップアップウィンドウのサイズ指定

    現在以下のような指定でポップアップウィンドウを開いているのですが Chromの場合、サイズ指定が無視されてしまいます。 良い方法ございましたら、ご教授いただけますでしょうか。 var subopen function subWinmap(){ subopen=window.open("map.html","map","resizable=yes,scrollbars=yes,menubar=yes,toolbar=no,directories=no,status=no,location=yes,width=700,height=800px"); if (!subopen.opener) subopen.opener=self; if (window.focus) subopen.focus(); }

専門家に質問してみよう