SyntaxError: expected expression, got ")" void() : 1: 5

This error means: had hoped to get an expression that has been missing),

Where such errors, that is a function of the current position, it requires an argument! Parameter is not given, enter) a right parenthesis!

Error Position 1: 5, refers to the location of the first five, you need parameters.

Such errors are usually two circumstances:

  1. First, func (a, b,) there is a significant parameter, and more than a comma behind the argument that such a syntax error is relatively easy to see out;

  2. Second, funcName (), brackets absolutely no substance, they reported directly to this wrong. And this function must have a parameter, you did not give the parameters, it will report this error! But this is the wrong comparison secret, is not easy to be detected is!

For example, the previous time, javascript:! Void (); do not give a parameter, the browser is not being given ?? ff and ff is now being given to the mandatory must give him a parameter, such as the ratio 0

=================================================

About void has two main purposes:

  1. First, instead of using void 0: undefined undefined because not js keywords (reserved words).
  2. Instead, it is used instead of unnecessary links and addresses: For example: href a value for the property, for the equivalent img src, you can use: "javascript: void (0)" to represent.

In short,: now ff browser: void () must take the argument 0 otherwise js will complain!!

Guess you like

Origin www.cnblogs.com/bkylee/p/11020134.html