We all know that Java is a strong type of language, and JS is a weak type of language, in fact, the difference between them is not only this, there are method parameters and call problems, see the following example:
JS: A query () method is defined here
function query () {
var blacklistnumber=$ (' #blacklistNumber '). Val ();
var blacklistname=$ (' #blacklistName '). Val ();
var blacklistsex = $ (' #blacklistSex '). Val ();
Queryobj.blacklistnumber = Blacklistnumber;
Queryobj.blacklistname = Blacklistname;
Queryobj.blacklistsex = Blacklistsex;
var params = json.stringify (queryobj);
var param = encodeuricomponent (params);
Tab.load ({
Pagenumber:1,
Type: ' POST ',
Data: ' param= ' +param+ ' ¶ms= ' +math.random (),
Success:function () {}
});
}
However, when called elsewhere, the query (1)is used, and it is inconceivable that it will enter the query () method as well, because if we call the function as shown in the Java method, it should be the same as the method signature. and method name and method parameters should be consistent, originally, the JS method does not exist method overloads, such as the above example, if followed by a number of methods to define a method named query, such as query (A, B), query (C,D,F), then the default finally self-query (1) You can only invoke query (C,D,F) ...
js Method Parameter Problem