質問編集履歴

3

試行錯誤の最新ソースに更新

2017/01/18 01:54

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -8,19 +8,25 @@
8
8
 
9
9
  動作と致しましては、
10
10
 
11
- [Go] このページでGoogleを表示する
12
-
13
- [Athor Go] 新しいウィンドウにYahooを表示する
11
+ [Yahoo] 新しいウィンドウにYahooを表示する
14
12
 
15
13
  と言ったモノです
16
14
 
17
15
 
18
16
 
17
+ 実際には、formに値を入れてアクションページに遷移する予定です。
18
+
19
+
20
+
19
21
  ###発生している問題・エラーメッセージ
20
22
 
21
- 問題点は、Chrome Firefoxでは思っ通り動きをします
23
+ 問題点は、Chrome Firefoxでは、呼び出しウィンドウはそままで、新いウィンドウにYahooが表示されます。
22
24
 
25
+
26
+
23
- Edge IEにおいて、[Athor Go]を押下すると新しいウィンドを表示した後に、メインウィンドYahooにつなウィンドウが空白のまという状況です。
27
+ Edge IEにおいて、[Yahoo]を押下すると新しいウィンドを表示した後に、新しいウィンドYahooが表示されず白いままで呼び出たボタンのあるウィンドウがyahooが表示されます。
28
+
29
+
24
30
 
25
31
 
26
32
 
@@ -28,55 +34,93 @@
28
34
 
29
35
  ```<html>
30
36
 
31
- <body>
37
+ <body>
32
38
 
33
- <form id="mainform" action="http://google.co.jp" >
39
+ <form id="mainform" action="" >
34
40
 
35
- <input type="submit" value="Go" />
41
+ <input type="button" id="yahoo" value="yahoo" />
36
42
 
37
- <input type="button" id="athor" value="Athor Go" />
38
-
39
- </form>
43
+ </form>
40
44
 
41
45
  <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
42
46
 
43
- <script>
47
+ <script>
44
-
45
- $("#athor").click(function(){
46
48
 
47
49
 
48
50
 
49
- var form = $("#mainform");
51
+ var form = $("#mainform");
52
+
53
+ $("#yahoo").on("click", function(){
54
+
55
+ // Edgeも動きます。
56
+
57
+ // window.open("","win","width=900,height=480").location = "http://yahoo.co.jp";
50
58
 
51
59
 
52
60
 
61
+ // Edge:NG 開いたwinでなく。呼び出したウィンドウがジャンプします。
62
+
53
- win = window.open("","win","width=900,height=980").name;
63
+ // win = window.open("","win","width=900,height=480");
64
+
65
+ // win.location = "";
66
+
67
+ //
68
+
69
+ // var currentForm = $("#mainform").clone();
70
+
71
+ // currentForm.attr("action","http://yahoo.co.jp");
72
+
73
+ // currentForm.attr("target",win.name);
74
+
75
+ // currentForm.submit();
54
76
 
55
77
 
56
78
 
57
- form.attr('target', win);
79
+ // Edge:NG 上と同じく呼び出したウィンドウがジャンプします
58
80
 
81
+ // win = window.open("","win","width=900,height=480");
82
+
83
+ // var currentForm = $("#mainform").clone();
84
+
59
- form.attr('action', "http://yahoo.co.jp");
85
+ // currentForm.attr({"action":"http://yahoo.co.jp","target":win.name});
86
+
87
+ // currentForm.submit();
60
88
 
61
89
 
62
90
 
63
-
91
+ // Methodの切り替えも意味はない
64
92
 
65
- $("#mainform").submit();
93
+ // win = window.open("","win","width=900,height=480");
66
94
 
67
-
95
+ // var currentForm = $("#mainform").clone();
68
96
 
97
+ // currentForm.attr({"Method":"GET","action":"http://yahoo.co.jp","target":win.name});
98
+
69
- return false;
99
+ // currentForm.submit();
70
100
 
71
101
 
72
102
 
103
+ // 無理矢理
104
+
105
+ win = window.open("","win","width=900,height=480");
106
+
107
+ var newForm = $("<form id='newform' action='http://yahoo.co.jp' target='" + win.name + "'>");
108
+
109
+ newForm.html($("#mainform").clone().html());
110
+
73
- });
111
+ newForm.submit();
74
112
 
75
113
 
76
114
 
77
- </script>
115
+ return false;
78
116
 
117
+
118
+
119
+ });
120
+
121
+ </script>
122
+
79
- </body>
123
+ </body>
80
124
 
81
125
  </html>
82
126
 
@@ -88,6 +132,8 @@
88
132
 
89
133
  様々IDのキャッシュなど様々試しましたが、解決できず投稿させていただきました。
90
134
 
135
+ 試行錯誤を更新して、コメントアウト部分にいろいろ試してみましたが無理でした。
136
+
91
137
 
92
138
 
93
139
  皆様のお知恵よろしくお願いします。

2

ソース修正

2017/01/18 01:54

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -54,9 +54,9 @@
54
54
 
55
55
 
56
56
 
57
- form.attr('target', win);
57
+ form.attr('target', win);
58
58
 
59
- form.attr('action', "http://yahoo.co.jp");
59
+ form.attr('action', "http://yahoo.co.jp");
60
60
 
61
61
 
62
62
 
@@ -65,12 +65,6 @@
65
65
  $("#mainform").submit();
66
66
 
67
67
 
68
-
69
- form.attr('action', action);
70
-
71
- form.attr('target', target);
72
-
73
-
74
68
 
75
69
  return false;
76
70
 

1

該当コードを<code>で括る修正

2017/01/10 09:38

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  ###該当のソースコード
28
28
 
29
- <html>
29
+ ```<html>
30
30
 
31
31
  <body>
32
32
 
@@ -86,6 +86,8 @@
86
86
 
87
87
  </html>
88
88
 
89
+ ```
90
+
89
91
 
90
92
 
91
93
  ###試したこと