What is the difference between "javascript :;" and "javascript:" in the anchor attribute href?
href
Same as the difference between an empty Javascript file and a Javascript file all in all ;.
;
Nothing
eval(""); //undefined eval(";"); //undefined
See http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1
When, when a program is parsed from left to right, the end of the input token stream occurs, and the parser cannot parse the input token stream as one complete ECMAScript program, then a semicolon is automatically inserted at the end of the input stream.
, , .
, , JSON Javascript: JSON :
JSON.parse(""); //SyntaxError: Unexpected end of input eval(""); //undefined
:
javascript: , JavaScript. , script, ;, , . javascript: - , script, . undefined, , URL- javascript:, - , , .
javascript:
undefined
javascript: urls - . onclick href, #, -js- . , Default.
onclick
#
javascript: , javascript, . ; - javascript. ; , -op.
javascript:;has javascript:c and an extra semicolon. In addition, there are no differences.
javascript:;