海边:HTML锚点上的2个事件 [英] seaside : 2 events on html anchor

查看:93
本文介绍了海边:HTML锚点上的2个事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在海边,我需要做两个事件-回调并单击链接进入另一个URL(google.com),但是我不能同时做这两个事情.在这里可能出什么问题了?我有什么办法可以做这两个事件吗?

In seaside I need to do two events - callback and go to the other url (google.com) on clicking a link but I am not able to do both of them. What could be possibly wrong here? Is there any way I can do both the events?

html anchor
    newTarget url: 'www.google.com';
    callback: [Transcript show: 'clicked on google.com'];
    with: ('www.google.com') .

推荐答案

由于>> callback:和>> url:都更新了Anchor标记上的href属性,因此您不能在同一锚上同时使用这两个属性.您必须编写一种执行逻辑的回调方法来解决此问题,然后使用javascript在新窗口中打开页面.

Because >>callback: and >>url: both update the href attribute on an Anchor tag, you can't use both on the same anchor. You will have to solve this by writing a callback method which executes your logic, and then uses javascript to open the page in a new window.

希望有帮助!

这篇关于海边:HTML锚点上的2个事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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