チェックアウトを続行するために、ダイアログの iframe への非表示の FORM 投稿を試みています。これは、ショッピング カートをいっぱいにして、転送されたカートでウィンドウを開いて、別の場所でチェックアウトするという古典的なシナリオです (別のサーバーの checkoutUrl)。
var form = $('<form>').attr({
id : 'checkoutform',
name : 'checkoutform',
method : "post",
enctype : "multipart/form-data",
action : checkoutUrl,
target : "checkout"
}).appendTo('body');
$('<input>').attr({
type : 'hidden',
name : 'osCsid',
value : osCsid
}).appendTo(form);
var iFrame = $('#iframe');
if (iFrame.length == 0) {
$('<iframe name="checkout" id="iframe" src=""></iframe>').appendTo('body');
iFrame = $('#iframe');
}
iFrame.dialog({
autoOpen : false,
position : [ 'center', 'center' ],
dialogClass : 'shit-theme',
closeOnEscape : true,
modal : true
});
form.submit();
iFrame.dialog('open');
form.remove();
ネットログを確認すると、iframe のロード中に多くの余分なリクエストが表示されます。
Name Method Status Type Initiator Size Time Receiving
checkout.php GET 302 text/html jquery.js:5763 542B 142ms 38ms
login.php GET (canceled) undefined http://xdmhost/checkout.php 13B 123ms
checkout.php GET (canceled) undefined jquery.js:5763 13B 3ms
checkout.php GET (canceled) undefined jquery.js:5763 13B 3ms
checkout.php GET (canceled) undefined jquery.js:5763 13B 5ms
checkout.php GET (canceled) undefined jquery.js:5763 13B 31ms
checkout.php GET (canceled) undefined jquery.js:5763 13B 21ms
checkout.php POST 302 text/html Other 542B 134ms 93ms41ms
checkout.php GET 302 text/html jquery.js:5779 541B 194ms 63ms131ms
私がやりたかったのは、チェックアウトに POST することだけでした。これにより、ログインへのリダイレクトが発生するはずです。何が起きてる?アイデアはありますか?