如何将一个G:链接到一个普通的按钮? [英] How to incorporate a g:link into an ordinary button?

查看:187
本文介绍了如何将一个G:链接到一个普通的按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的的Grails 应用程序有一个视图与AA G:链接标签 - 它工作正常,但视觉效果是一种尴尬。因此,我想掩饰 G:链接用普通的按钮

In my grails application there is a view with a a g:link tag - it works fine, but the visuals are kind of awkward. Therefore, I want to disguise that g:link with an ordinary button.

我试过跨度类输入类型=按钮但这并没有这样的伎俩。结果边注:我不想 G:形式提交的行动。

I've tried a span class and input type="button" but this did not do the trick.
Side note: I don't want a g:form with an submit action.

任何帮助真的AP preciated!

Any help is really appreciated!

推荐答案

阿米特耆那教的答复工作,但在IE 8和有一些问题; 7(看上去像某种风格重叠的错误)。该解决方案在我测试的所有浏览器的工作。

Amit Jain's answer worked but had some problems in ie 8 & 7 (looked like some kind of style overlapping error). This solution worked in all browsers I tested

<button class="class" onClick="window.location = 'www.location.com' ">
    <g:message code="share.learnmore"></g:message>
</button>

这篇关于如何将一个G:链接到一个普通的按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆