Use one javascript variable into another javascript file
Question
This is common.js
jQuery(function ($) {
var commonJs = {
init: function () {
},
showAlert: function () {
},
}
});
This is add.js
jQuery(function ($) {
var addJs = {
init: function () {
console.log(commonJs.showAlert);
},
}
});
I want to use common js function commonJs.showAlert in add.js
How can i access that?
0
javascript, jquery, variables
10 months
0 Answers
114 views
0
Leave an answer
You must login or register to add a new answer .