【发布时间】:2011-10-11 13:08:07
【问题描述】:
我正在使用对这个 JavaScript 函数的调用提交一个表单:
function emailFriend(){
jQuery("form[name='comparisons']").attr("action", "/emailfriend/compare");
jQuery("form[name='comparisons']").bind('submit', function() {
jQuery.get(jQuery("form[name='comparisons']").attr("action"),
jQuery("form[name='comparisons']").serialize(),
function(data){ // send to colorbox
$.colorbox({ // this is where the error comes from
html: data,
open: true,
iframe: true // use iframe
});
},
"html");
});
jQuery("form[name='comparisons']").submit();
}
此表单打开位于 /emailfriend/compare 的另一个表单。第二种形式是我试图在颜色框中弹出的形式。上面的代码可以打开表单,但它会返回错误$.colorbox is not a function,然后在同一窗口/选项卡中打开目标表单。
我正在使用安装并启用了 colorbox 模块的 Drupal 7。当将其用于链接、图像等时,颜色框方面适用于整个网站。
谁能告诉我我做错了什么?
【问题讨论】:
标签: jquery drupal drupal-7 colorbox