This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*假设有2个函数firstFunction和secondFunction需要在网页加载完毕时执行, 需要绑定到window。onload。如果通过: | |
* | |
* window.onload = firstFunction; | |
* window.onload = secondFunction; | |
* 结果是只有secondFunction会执行,secondFunction会覆盖firstFunction。 | |
*/ | |
/* | |
*正确的方式是: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [status, result] = git(varargin) | |
cmd = '"c:\Program Files\Git\cmd\git.cmd"'; | |
for i = 1:numel(varargin) | |
cmd = [cmd ' ' varargin{i}]; | |
end | |
switch nargout | |
case 0, system(cmd); | |
case 1, [status] = system(cmd); | |
case 2, [status, result] = system(cmd); |