You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by pa...@apache.org on 2013/10/28 09:46:18 UTC

[11/27] git commit: Sumit with GET method to the iframe for multipart Ajax submit in PhantomJS/NodeJS.

Sumit with GET method to the iframe for multipart Ajax submit in PhantomJS/NodeJS.

For some reason POST doesn't work (error message: Cannot POST to http://localhost:post/test/js/data/submitNestedForm.xml?...)


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/6c6dee01
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/6c6dee01
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/6c6dee01

Branch: refs/heads/wicket-4997
Commit: 6c6dee01c708a6e48ffc8770472f942d875bfbe3
Parents: 9ce66e9
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Sep 30 22:24:56 2013 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Sep 30 22:29:41 2013 +0200

----------------------------------------------------------------------
 .../java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/6c6dee01/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index a49ad61..d5440ee 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -822,8 +822,8 @@
 					form.action = form.action + '&' + dynamicExtraParameters;
 				}
 			}
-
-			form.method = "post";
+			// PhantomJS cannot submit with POST to iframe
+			form.method = /PhantomJS/.test(navigator.userAgent) ? 'get' : 'post';
 			form.enctype = "multipart/form-data";
 			form.encoding = "multipart/form-data";