如何将一个G:链接到一个普通的按钮? [英] How to incorporate a g:link into an ordinary button?
问题描述
在我的的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屋!