What does an empty javascript link mean?

I checked the inbox link in hotmail with firebug and saw something like this:

<a ... href="javascript:; .... /> 

I just can't figure out how the postback is implemented when I click the link. And what does "javascript :;" do Does it mean that it does not belong to any function?

+3
source share
2 answers

In part javascript:there is a pseudo-protocol, meaning that the URI should be interpreted as JavaScript code. ;immediately after he is the terminator of the statement. Assuming nothing follows, basically this makes the link do nothing when clicked.

- , , click -. click DOM, .

HTML; .

# 1 ( click )

# 2 ( click -)

+5

;, . , - href ( ).

. , - jQuery: $('#inboxLink').click(goToInboxFunction)

, @T.J. Crowder , click DOM , .

+2

Source: https://habr.com/ru/post/1782776/


All Articles