无法推迟或延迟 ColdFusion.navigate() 、 ColdFusion.Ajax.submitForm()
也许 Coldfusion 的 Ajax 功能有些奇怪,但我无法弄清楚这个...我只是想使用 ColdFusion.Ajax.submitForm
发布一些数据,然后将新内容加载到 # CartPopup 使用
ColdFusion.navigate
。在加载 Div
之前,我需要 Details.cfm
来完成表单数据的处理。
function add2Cart(prodid){
var submit = ColdFusion.Ajax.submitForm('AddToCart', 'Details.cfm');
setTimeout("navigate(prodid)", 2000);
}
function navigate(prodid){
ColdFusion.navigate('divbind.cfm?PRODID='+ prodid,'CartPopup','CB','EH');
return false;
}
也许拖延并不是最好的办法。我想过使用:
jQuery.when
但我想知道 CF ajax 函数是否可能是我的问题......我非常感谢任何见解或替代方法。
谢谢!
Maybe there is something screwy with Coldfusion's Ajax functions, but I cant figure this one out... Im just trying to post some data using ColdFusion.Ajax.submitForm
, then load new content into #CartPopup
using ColdFusion.navigate
. I need Details.cfm
to finish processing the form data before I load the Div
.
function add2Cart(prodid){
var submit = ColdFusion.Ajax.submitForm('AddToCart', 'Details.cfm');
setTimeout("navigate(prodid)", 2000);
}
function navigate(prodid){
ColdFusion.navigate('divbind.cfm?PRODID='+ prodid,'CartPopup','CB','EH');
return false;
}
Do perhaps a delay isn't the best way. I thought of using:
jQuery.when
but I'm wondering if maybe my issue if with the CF ajax functions... I'm super grateful for any insight or alternative approaches.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的第一个代码片段应该是:
如您所见 here
submitForm
可以接收 2 个回调处理程序,一个用于提交完成,另一个用于错误处理。Your first snippet of code should be:
As you can see here
submitForm
can receive 2 callback handlers, one when the submit is done and one for error handling.