javascript - How to add content to function in another file
phpcn_u1582
phpcn_u1582 2017-05-18 10:49:31
0
1
368

Test.html calls two js files a.js and b.js:

There is a

in the a.js file
function test(){
    console.log(1);
}

Now I want to add a

to the test function in b.js
console.log(2);

The goal is to output 1 and 2 no matter where test() is called, how to write it

phpcn_u1582
phpcn_u1582

reply all(1)
巴扎黑
var rawTest = test;
test=function(){
    rawTest();
    console.log(2);
}

//
test();

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template