从锚点html标记调用javascript函数

时间:2022-11-27 18:00:33

I need to display message when the user clicks link

当用户点击链接时,我需要显示消息

How can I implement something where once the user click the hyper link on Page1, a "processing..." message and then as soon as Page2 is ready it forwards to Page2?

当用户点击Page1上的hyper链接,一个“处理…”消息,当Page2准备好后,我如何实现它?

It is working for button click which I earlier posted got response implemented successfully.Thanks.

它正在为按钮点击工作,我之前发布的得到了成功的响应,谢谢。

Hidden DOM element containing the message and to make it visible

隐藏的DOM元素,包含消息并使其可见。

Same thing I tried to implement for the below HTML code which is using Servlet not sure how to implement

同样的事情,我尝试为下面的HTML代码实现,它使用Servlet不知道如何实现

        <a href="<%=request.getContextPath()%>/servlet/VisibilityController?searchType=workSearchDetails&workNo=<%=installAtLocListBean.getWorkNumber()%>&ID=<%= firstLocationNumber %>&sitePosition=<%=pagePosition%>"><%=installAtLocListBean.getWorkNumber()%>onclick="MyFunction();return true;"</a></td>

Can any body help me is it possible to do as button click any examples please Thanks in advance

有没有人可以帮我做一下按钮点击任何例子,谢谢

1 个解决方案

#1


18  

You can use either

您可以使用

<a href="javascript:someFunction()">LINK</a>

or

<a href="#" onclick="someFunction(); return false;">LINK</a>

or you can check this link. anchor tag onclick function

或者你可以查看这个链接。锚标记onclick功能

#1


18  

You can use either

您可以使用

<a href="javascript:someFunction()">LINK</a>

or

<a href="#" onclick="someFunction(); return false;">LINK</a>

or you can check this link. anchor tag onclick function

或者你可以查看这个链接。锚标记onclick功能