Grails 2.0 问题渲染 FancyBox

标签 grails fancybox grails-2.0 fancybox-2

使用 Grails 2.0.4 和 FancyBox 2。

我正在尝试在 grails 框架的模式或对话框弹出窗口中呈现 html。目前我正在尝试使用 FancyBox 2 来执行此操作。但是我似乎无法渲染 fancybox。这是我目前拥有的。

Controller :

class TestController {

def index() { }

def createResult() {
    render 'got here dude'
}

}

从 gsp 中发挥作用:
    <body>
    //attempts to use fancy box but fails 
    <a class="fb" href="${createLink(action: 'createResult', controller: 'test') }" >Click Here</a>
    //not fancy box, renders page only
    <a class="not" href="${createLink(action: 'createResult', controller: 'test') }" >Click Here2</a>
    <script type="text/javascript">
    $(document).ready(function() {
        $(".fb").fancybox();
    });
    </script>
</body>

通过单击顶部链接,我最终收到以下错误:
Uncaught Error :语法错误,无法识别的表达式:/ModalTest/test/createResult

有没有人对如何让它与 grails 一起工作或有另一个可以通过使用 Controller 工作的对话框/模态解决方案有任何建议?

先感谢您。

最佳答案

加类 花式框.ajax ,这应该有效,因为您正在尝试加载 ajax 内容:

<a class="fb fancybox.ajax" href="${createLink(action: 'createResult', controller: 'test') }" >Click Here</a>

关于Grails 2.0 问题渲染 FancyBox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11724342/

相关文章:

grails - Spring Boot、GORM 和单元测试

plugins - 如何安全地更新 grails 插件

tomcat - 为什么 grails run-war 拒绝远程连接?

jquery - 如何在灯箱 View Fancybox 中悬停图像时添加描述

grails - 是否有像Grails的身份验证插件那样的Devise(Rails)?

grails - Grails 2.3.8仅在生产环境中禁用操作

grails - 如何根据拒绝访问的原因使Grails的Spring Security Core呈现不同的页面

jquery - jQuery 和 Fancybox 中的视频(本地视频文件 mp4 而不是 Youtube)

javascript - 卡在奇怪的 jQuery 错误上

grails - Grails Resources提供资源进行处置[defer]警告?