0
我的頁面上有一個表單。
它有一個圖像提交按鈕。
有沒有辦法在fancybox iframe中打開提交結果?表單提交結果到FancyBox
我的頁面上有一個表單。
它有一個圖像提交按鈕。
有沒有辦法在fancybox iframe中打開提交結果?表單提交結果到FancyBox
我可以想到這樣做的一種方法。
使用jQuery你可以做這樣的事情。
$(function(){
$("#id_of_form").submit(function(e){
e.preventDefault();
var req = $.ajax({
type: 'POST',
url: $(this).attr("action"),
data: $(this).serialize(),
dataType: "json"
});
req.success(function(resp){
//resp is data back from server
//Here you write logic for opening the fancybox iframe
});
});
});
希望這會有所幫助。
剛剛找到smth。喜歡這個。謝謝。 – lvil